/* UNU-INWEH Applications portal (sign-in page and applications list). Colours from unu.edu/inweh. */
:root {
  color-scheme: light;
  --navy: #15234a; --navy-2: #1d3366; --blue: #4097db; --sky: #7cc0f2; --link: #0779bf;
  --page: #f3f6fa; --surface: #ffffff; --surface-2: #f1f5fa; --text: #15234a; --text-2: #475069; --muted: #6b7489;
  --border: rgba(21, 35, 74, .12); --ok: #047857; --ok-bg: #d1fae5;
  --shadow: 0 1px 2px rgba(21, 35, 74, .06), 0 12px 32px rgba(21, 35, 74, .08);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0b1226; --surface: #111a33; --surface-2: #18223f; --text: #eef2f9; --text-2: #c2cadb; --muted: #8e98ad;
    --border: rgba(255, 255, 255, .1); --link: #4fa6e6; --ok: #6ee7b7; --ok-bg: rgba(16, 185, 129, .15);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0b1226; --surface: #111a33; --surface-2: #18223f; --text: #eef2f9; --text-2: #c2cadb; --muted: #8e98ad;
  --border: rgba(255, 255, 255, .1); --link: #4fa6e6; --ok: #6ee7b7; --ok-bg: rgba(16, 185, 129, .15);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--page); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- display switch (system / light / dark) ---------- */
.themes { display: inline-flex; padding: 2px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); }
.themes button { border: 0; background: none; color: var(--muted); padding: 6px; border-radius: 999px; cursor: pointer; display: grid; place-items: center; }
.themes button:hover { color: var(--text); }
.themes button[aria-checked="true"] { background: var(--navy); color: #fff; }
.themes svg.i { width: 14px; height: 14px; }
.on-navy .themes { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.08); }
.on-navy .themes button { color: rgba(255,255,255,.8); }
.on-navy .themes button:hover { color: #fff; background: rgba(255,255,255,.12); }
.on-navy .themes button[aria-checked="true"] { background: #fff; color: var(--navy); }

/* ---------- water ripples (brand motif) ---------- */
.ripples { position: absolute; pointer-events: none; border-radius: 50%; }
.ripples span { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(140, 200, 245, .28); animation: ripple 10s linear infinite; }
.ripples span:nth-child(2) { animation-delay: -2.5s; }
.ripples span:nth-child(3) { animation-delay: -5s; }
.ripples span:nth-child(4) { animation-delay: -7.5s; }
@keyframes ripple { from { transform: scale(.12); opacity: 0; } 15% { opacity: 1; } to { transform: scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .ripples span { animation: none; opacity: .5; }
  .ripples span:nth-child(1) { transform: scale(.35); } .ripples span:nth-child(2) { transform: scale(.6); } .ripples span:nth-child(3) { transform: scale(.85); }
}

/* ================= sign-in page ================= */
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1.15fr 1fr; }
.brand-side { position: relative; overflow: hidden; color: #fff; display: flex; flex-direction: column; padding: 40px clamp(24px, 5vw, 64px);
  background: radial-gradient(900px 600px at 100% 0%, #2a5aa8 0%, transparent 60%), radial-gradient(700px 500px at 0% 100%, #10305e 0%, transparent 60%), linear-gradient(150deg, var(--navy) 0%, var(--navy-2) 100%); }
.brand-side .ripples { width: 900px; height: 900px; right: -320px; bottom: -380px; }
.brand-side .logo { height: 46px; width: auto; position: relative; align-self: flex-start; }
.brand-side .copy { position: relative; margin: auto 0; padding: 48px 0; max-width: 560px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #8cc8f5; }
.brand-side h1 { font-size: clamp(34px, 4.6vw, 58px); line-height: 1.04; margin: 16px 0 16px; font-weight: 800; letter-spacing: -.025em; }
.brand-side h1 em { font-style: normal; color: var(--sky); }
.brand-side p { margin: 0; font-size: 18px; line-height: 1.55; color: rgba(255,255,255,.78); }
.pillars { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.pillars span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); }
.brand-side .foot { position: relative; font-size: 13px; color: rgba(255,255,255,.6); }
.brand-side .foot a { color: rgba(255,255,255,.85); font-weight: 600; text-decoration: none; }

.form-side { position: relative; display: flex; flex-direction: column; padding: 32px clamp(20px, 4vw, 56px); background: var(--page); }
.form-side .top { display: flex; justify-content: flex-end; }
.card { width: 100%; max-width: 420px; margin: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 20px 20px 48px 20px;
  box-shadow: var(--shadow); padding: clamp(28px, 4vw, 40px); position: relative; }
.card::before { content: ""; position: absolute; left: 0; top: 24px; bottom: 24px; width: 4px; border-radius: 0 4px 4px 0; background: var(--blue); }
.card .emblem { width: 52px; height: 52px; border-radius: 14px; display: block; }
.card h2 { margin: 20px 0 6px; font-size: 28px; font-weight: 800; letter-spacing: -.015em; }
.card .hint { margin: 0 0 24px; color: var(--text-2); font-size: 15px; line-height: 1.5; }
.ms-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; font: inherit; font-size: 16px; font-weight: 700;
  padding: 14px 18px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: not-allowed; position: relative; }
.ms-btn .ms { display: grid; grid-template-columns: 9px 9px; gap: 2px; filter: grayscale(.9); opacity: .6; }
.ms-btn .ms i { width: 9px; height: 9px; display: block; }
.ms-btn .lbl { opacity: .55; }
.ms-btn .soon { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; background: var(--navy); color: #fff; }
.ms-btn .soon svg.i { width: 12px; height: 12px; }
.note { display: flex; gap: 10px; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); font-size: 13px; line-height: 1.5; }
.note svg.i { margin-top: 2px; color: var(--link); }
.or { display: flex; align-items: center; gap: 12px; margin: 26px 0 18px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.guest { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border);
  transition: border-color .15s, transform .15s, background .15s; }
.guest:hover { border-color: var(--blue); transform: translateY(-1px); background: var(--surface-2); }
.guest .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--link); border: 1px solid var(--border); flex: none; }
.guest b { display: block; font-size: 15px; }
.guest small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.guest .go { margin-left: auto; color: var(--link); transition: transform .15s; }
.guest:hover .go { transform: translateX(3px); }
.form-side .legal { text-align: center; font-size: 12px; color: var(--muted); margin-top: 24px; }

@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .brand-side { padding: 28px 20px 40px; }
  .brand-side .copy { margin: 0; padding: 28px 0 0; }
  .brand-side .foot { display: none; }
  .brand-side .ripples { width: 560px; height: 560px; right: -240px; bottom: -300px; }
  .brand-side .logo { height: 38px; }
  .brand-side p { font-size: 16px; }
  .form-side { padding: 0 16px 32px; }
  .form-side .top { position: absolute; top: -52px; right: 16px; }
  .card { margin-top: -24px; }
}
@media (max-width: 420px) {
  .pillars span { font-size: 13px; padding: 6px 12px; }
  .ms-btn { font-size: 15px; gap: 10px; padding: 14px 12px; }
}

/* ================= applications page ================= */
header.bar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 10; }
header.bar .in { max-width: 1120px; margin: 0 auto; padding: 0 16px; height: 64px; display: flex; align-items: center; gap: 12px; }
header.bar .brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
header.bar .brand img { height: 34px; display: block; }
header.bar .brand span { border-left: 1px solid rgba(255,255,255,.25); padding-left: 12px; font-weight: 600; font-size: 14px; }
header.bar .side { margin-left: auto; display: flex; align-items: center; gap: 8px; }
header.bar .out { color: rgba(255,255,255,.85); text-decoration: none; font-size: 14px; font-weight: 600; padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); }
header.bar .out:hover { background: rgba(255,255,255,.1); }
.apps-hero { position: relative; overflow: hidden; color: #fff; background: linear-gradient(150deg, var(--navy) 0%, var(--navy-2) 100%); }
.apps-hero .ripples { width: 640px; height: 640px; right: -180px; top: -260px; }
.apps-hero .in { position: relative; max-width: 1120px; margin: 0 auto; padding: 40px 16px 88px; }
.apps-hero h1 { margin: 10px 0 6px; font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -.02em; }
.apps-hero p { margin: 0; color: rgba(255,255,255,.78); font-size: 16px; }
.apps { max-width: 1120px; margin: -56px auto 0; padding: 0 16px 48px; position: relative; display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.app { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--blue);
  border-radius: 16px 16px 40px 16px; padding: 24px; box-shadow: var(--shadow); text-decoration: none; color: inherit; transition: transform .15s, border-color .15s; }
a.app:hover { transform: translateY(-3px); border-color: var(--blue); }
.app .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--link); border: 1px solid var(--border); }
.app .ic svg.i { width: 22px; height: 22px; }
.app .tag { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.app .state { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); }
.app h2 { margin: 18px 0 6px; font-size: 20px; }
.app p { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.55; }
.app .go { margin-top: auto; padding-top: 22px; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--link); }
.app.off { border-left-color: var(--border); cursor: not-allowed; }
.app.off .ic { color: var(--muted); }
.app.off h2, .app.off p { opacity: .7; }
.app.off .state { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.app.off .go { color: var(--muted); }
footer.small { max-width: 1120px; margin: 0 auto; padding: 0 16px 32px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
footer.small a { color: inherit; font-weight: 600; }
@media (max-width: 900px) { .apps { grid-template-columns: 1fr; } }
@media (max-width: 480px) { header.bar .brand span { display: none; } }
