:root {
  color-scheme: dark;
  --ink: #f4f9fc;
  --muted: #a9c1d0;
  --gold: #dca456;
  --gold-soft: #f3cf91;
  --sky: #66cef4;
  --sky-soft: #b9ebff;
  --ocean: #0a4b70;
  --night: #031522;
  --panel: #08283d;
  --line: rgba(139,211,241,.18);
  --danger: #ff8585;
  --success: #75dca5;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--night); }
body { min-width: 280px; min-height: 100vh; min-height: 100dvh; margin: 0; color: var(--ink); background: var(--night); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.auth-page { display: grid; min-height: 100vh; min-height: 100dvh; place-items: center; padding: max(24px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); background:
  radial-gradient(circle at 14% 7%, rgba(102,206,244,.24), transparent 26rem),
  radial-gradient(circle at 88% 91%, rgba(24,118,165,.28), transparent 34rem),
  radial-gradient(circle at 79% 13%, rgba(220,164,86,.13), transparent 22rem),
  linear-gradient(145deg, #031522, #07314b 48%, #082a3b 72%, #241b18 135%); }
.auth-page::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .34; background-image: linear-gradient(rgba(139,211,241,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(139,211,241,.045) 1px, transparent 1px); background-size: 46px 46px; mask-image: radial-gradient(circle at center, black, transparent 77%); }
.auth-shell { position: relative; z-index: 1; width: min(100%, 460px); }
.portal-brand { display: flex; width: fit-content; align-items: center; gap: 13px; margin: 0 auto 24px; color: var(--ink); text-decoration: none; }
.portal-brand img { width: 72px; height: 52px; border: 1px solid rgba(220,164,86,.52); border-radius: 12px; object-fit: cover; box-shadow: 0 0 30px rgba(102,206,244,.12), 0 0 18px rgba(220,164,86,.1); }
.portal-brand span { display: grid; gap: 2px; }
.portal-brand strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.17rem; letter-spacing: .17em; }
.portal-brand small { color: var(--muted); font-size: .69rem; letter-spacing: .11em; text-transform: uppercase; }
.auth-card { padding: 42px; border: 1px solid rgba(139,211,241,.25); border-radius: 26px; background: linear-gradient(155deg, rgba(10,50,75,.96), rgba(5,27,43,.98) 62%, rgba(42,29,24,.94) 145%); box-shadow: 0 30px 90px rgba(0,10,20,.5), inset 0 1px 0 rgba(185,235,255,.06); }
.access-mark { position: relative; display: grid; width: 44px; height: 44px; place-items: center; margin-bottom: 30px; border: 1px solid rgba(102,206,244,.43); border-radius: 50%; background: linear-gradient(145deg, rgba(102,206,244,.14), rgba(220,164,86,.08)); animation: portal-heartbeat 2.35s ease-in-out infinite; }
.access-mark::before { content: ""; position: absolute; inset: -1px; border: 1px solid rgba(102,206,244,.48); border-radius: inherit; animation: portal-beacon-ring 2.35s ease-out infinite; }
.access-mark span { width: 12px; height: 12px; border-radius: 50%; background: var(--sky); box-shadow: 0 0 19px rgba(102,206,244,.82); animation: portal-beacon-core 2.35s ease-in-out infinite; }
.eyebrow { margin: 0 0 10px; color: var(--sky-soft); font-size: .7rem; font-weight: 750; letter-spacing: .17em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
.auth-card h1 { margin-bottom: 13px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 8vw, 2.85rem); font-weight: 500; letter-spacing: -.035em; }
.auth-intro { margin-bottom: 30px; color: var(--muted); font-size: .94rem; line-height: 1.68; }
form { display: grid; gap: 10px; }
label { margin-top: 7px; color: #d7e9f2; font-size: .76rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
input { width: 100%; min-height: 52px; border: 1px solid rgba(139,211,241,.24); border-radius: 11px; outline: 0; background: rgba(2,20,32,.74); color: var(--ink); padding: 0 15px; transition: border-color .18s, box-shadow .18s, background .18s; }
input:focus { border-color: rgba(102,206,244,.82); background: rgba(3,27,43,.9); box-shadow: 0 0 0 3px rgba(102,206,244,.12); }
.password-field { position: relative; }
.password-field input { padding-right: 67px; }
.reveal-button { position: absolute; right: 8px; top: 8px; bottom: 8px; border: 0; border-radius: 7px; background: transparent; color: var(--sky-soft); cursor: pointer; font-size: .77rem; font-weight: 700; }
.form-message { min-height: 21px; margin: 4px 0 0; color: var(--danger); font-size: .81rem; line-height: 1.45; }
.form-message.success { color: var(--success); }
.primary-button, .secondary-button { border: 0; border-radius: 10px; font-weight: 780; cursor: pointer; transition: transform .15s, opacity .15s, background .15s; }
.primary-button { position: relative; isolation: isolate; min-height: 52px; margin-top: 2px; overflow: hidden; border-radius: 999px; background: linear-gradient(115deg, var(--sky), #88dcf5 62%, var(--gold-soft)); color: #042033; box-shadow: 0 12px 30px rgba(44,157,207,.2); }
.primary-button::after { content: ""; position: absolute; z-index: -1; inset: -48% auto -48% -38%; width: 28%; transform: rotate(16deg); background: linear-gradient(90deg, transparent, rgba(255,255,255,.78), transparent); filter: blur(1px); animation: portal-life-sweep 3.7s ease-in-out infinite; }
.primary-button:hover { background: linear-gradient(115deg, #83dcfa, #a0e6fa 62%, #f1ce92); transform: translateY(-1px); }
.primary-button:focus-visible { outline: 2px solid var(--sky-soft); outline-offset: 4px; }
.primary-button:disabled, .secondary-button:disabled { cursor: wait; opacity: .58; transform: none; }
.primary-button:disabled::after { animation: none; opacity: 0; }
.access-note { display: grid; gap: 5px; margin-top: 27px; padding-top: 21px; border-top: 1px solid var(--line); }
.access-note strong { font-size: .83rem; }
.access-note span { color: var(--muted); font-size: .78rem; line-height: 1.5; }
.text-button { display: block; margin: 22px auto 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.auth-footer { margin: 22px 0 0; color: #7895a6; text-align: center; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }

/* Login gateway: desktop command surface, compact phone form. */
.login-shell { width: min(100%, 1040px); }
.login-brand { margin: 0 0 14px 8px; }
.login-stage { display: grid; min-height: 556px; grid-template-columns: minmax(0, 1.1fr) minmax(390px, .9fr); overflow: hidden; border: 1px solid rgba(139,211,241,.22); border-radius: 32px; background: linear-gradient(140deg, rgba(10,55,81,.96), rgba(4,29,46,.98) 58%, rgba(38,28,25,.94) 145%); box-shadow: 0 34px 100px rgba(0,10,20,.52), inset 0 1px 0 rgba(185,235,255,.07); }
.login-story { position: relative; display: flex; min-width: 0; flex-direction: column; justify-content: space-between; overflow: hidden; padding: clamp(38px, 4vw, 54px); background: radial-gradient(circle at 12% 5%, rgba(102,206,244,.22), transparent 22rem), radial-gradient(circle at 88% 94%, rgba(220,164,86,.14), transparent 20rem), linear-gradient(145deg, rgba(8,67,96,.72), rgba(4,34,53,.88)); }
.login-story::after { content: ""; position: absolute; width: 330px; height: 330px; right: -170px; bottom: -170px; border: 1px solid rgba(185,235,255,.09); border-radius: 50%; box-shadow: 0 0 0 55px rgba(185,235,255,.025), 0 0 0 110px rgba(185,235,255,.018); pointer-events: none; }
.login-story > * { position: relative; z-index: 1; }
.login-story h2 { max-width: 520px; margin: 18px 0 19px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.7rem, 4.25vw, 4.15rem); font-weight: 500; line-height: .98; letter-spacing: -.052em; }
.login-story h2 span { color: var(--gold-soft); }
.story-copy { max-width: 510px; margin-bottom: 0; color: var(--muted); font-size: .91rem; line-height: 1.68; }
.trust-list { display: grid; gap: 14px; margin: 32px 0; padding: 0; list-style: none; }
.trust-list li { display: grid; grid-template-columns: 32px 1fr; gap: 13px; align-items: center; }
.trust-list li > span { color: rgba(243,207,145,.66); font-family: Georgia, "Times New Roman", serif; font-size: .78rem; }
.trust-list li div { display: grid; gap: 2px; }
.trust-list strong { font-size: .79rem; letter-spacing: .025em; }
.trust-list small { color: #8faebe; font-size: .72rem; }
.authority-seal { display: flex; align-items: center; gap: 11px; padding-top: 18px; border-top: 1px solid rgba(139,211,241,.14); }
.authority-seal i { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 15px rgba(117,220,165,.55); }
.authority-seal span { display: grid; gap: 2px; }
.authority-seal strong { font-size: .74rem; }
.authority-seal small { color: #85a3b3; font-size: .68rem; }
.login-card { display: flex; min-width: 0; flex-direction: column; justify-content: center; padding: 34px 38px; border: 0; border-left: 1px solid rgba(139,211,241,.17); border-radius: 0; background: linear-gradient(158deg, rgba(7,38,58,.98), rgba(3,23,37,.99) 64%, rgba(39,27,23,.96) 150%); box-shadow: inset 0 1px 0 rgba(185,235,255,.035); }
.access-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; }
.login-card .access-mark { width: 38px; height: 38px; flex: 0 0 38px; margin: 0; }
.login-card .access-mark span { width: 10px; height: 10px; }
.login-card .eyebrow { margin: 0; }
.login-card h1 { margin-bottom: 10px; font-size: clamp(2.15rem, 3.6vw, 2.75rem); }
.login-card .auth-intro { margin-bottom: 21px; font-size: .88rem; line-height: 1.56; }
.login-card form { gap: 8px; }
.login-card label { margin-top: 4px; }
.login-card input { min-height: 50px; font-size: 1rem; }
.login-card .reveal-button { min-width: 48px; min-height: 44px; top: 3px; bottom: 3px; }
.login-card .form-message { min-height: 19px; margin-top: 1px; }
.login-card .primary-button { min-height: 50px; }
.login-card .access-note { margin-top: 19px; padding-top: 16px; }
.login-card .access-note span { line-height: 1.42; }
.login-shell .auth-footer { margin-top: 13px; }

.dashboard-page { background: radial-gradient(circle at 88% 4%, rgba(102,206,244,.14), transparent 32rem), radial-gradient(circle at 8% 92%, rgba(220,164,86,.08), transparent 28rem), var(--night); }
.portal-header { position: sticky; z-index: 10; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 82px; padding: 13px clamp(20px, 5vw, 76px); border-bottom: 1px solid var(--line); background: rgba(3,21,34,.88); backdrop-filter: blur(18px); }
.portal-header .portal-brand { margin: 0; }
.portal-brand.compact img { width: 58px; height: 42px; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.secure-status { display: flex; align-items: center; gap: 8px; color: #bdc1c8; font-size: .75rem; }
.secure-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 12px rgba(117,220,165,.6); }
.secondary-button { min-height: 39px; padding: 0 15px; border: 1px solid var(--line); background: #0a2a40; color: var(--ink); }
.secondary-button:hover { background: #103a55; }
.portal-main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: clamp(55px, 8vw, 100px) 0 70px; }
.portal-hero { display: grid; grid-template-columns: 1.55fr .65fr; gap: clamp(32px, 7vw, 95px); align-items: end; padding-bottom: clamp(48px, 7vw, 82px); border-bottom: 1px solid var(--line); }
.portal-hero h1 { max-width: 760px; margin-bottom: 18px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.5rem, 6vw, 5.2rem); font-weight: 500; line-height: .98; letter-spacing: -.05em; }
.portal-hero > div:first-child > p:last-child { max-width: 650px; margin-bottom: 0; color: var(--muted); line-height: 1.7; }
.session-panel { display: grid; grid-template-columns: 1fr auto; gap: 10px 18px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.025); }
.session-panel span { color: var(--muted); font-size: .74rem; }
.session-panel strong { font-size: .76rem; text-transform: capitalize; }
.service-section { padding: clamp(50px, 7vw, 82px) 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 27px; }
.section-heading h2, .portal-principle h2 { margin-bottom: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.75rem, 4vw, 3rem); font-weight: 500; letter-spacing: -.035em; }
.connection-pill { padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .7rem; white-space: nowrap; }
.connection-pill.ready { border-color: rgba(117,220,165,.3); color: var(--success); }
.service-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.service-card { position: relative; display: flex; min-height: 300px; flex-direction: column; overflow: hidden; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, #0b3049, #051b2b 72%, #211a17); }
.service-card::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 100% 0, rgba(102,206,244,.13), transparent 38%), radial-gradient(circle at 0 100%, rgba(220,164,86,.07), transparent 42%); }
.service-card[data-service="watcher-v2"] { border-color: rgba(239,184,78,.31); }
.service-card[data-service="watcher-v2"]::after { content: "PRIMARY"; position: absolute; right: 19px; top: 19px; color: var(--gold); font-size: .59rem; font-weight: 800; letter-spacing: .14em; }
.service-icon { display: grid; width: 42px; height: 42px; place-items: center; margin-bottom: auto; border: 1px solid rgba(239,184,78,.28); border-radius: 10px; color: var(--gold); font-family: Georgia, serif; }
.service-card h3 { margin: 30px 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: 1.5rem; font-weight: 500; }
.service-card p { min-height: 48px; margin-bottom: 22px; color: var(--muted); font-size: .85rem; line-height: 1.6; }
.service-link, .service-disabled { display: flex; min-height: 44px; align-items: center; justify-content: space-between; padding: 0 14px; border-radius: 8px; font-size: .76rem; font-weight: 800; text-decoration: none; }
.service-link { border: 0; background: linear-gradient(115deg, var(--sky), #9bdef3); color: #042033; cursor: pointer; }
.service-link:hover { background: linear-gradient(115deg, #86ddfb, #b0eafa); }
.service-link:disabled { cursor: wait; opacity: .66; }
.service-disabled { border: 1px solid var(--line); color: #727780; }
.skeleton { height: 14px; border-radius: 999px; background: linear-gradient(90deg, #171a20, #22262e, #171a20); background-size: 200%; animation: shimmer 1.3s infinite; }
.skeleton.short { width: 34%; margin: 65px 0 28px; }
.skeleton.button { height: 44px; margin-top: auto; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes portal-heartbeat {
  0%, 36%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(102,206,244,0); }
  41% { transform: scale(1.1); box-shadow: 0 0 22px rgba(102,206,244,.34); }
  46% { transform: scale(1); box-shadow: 0 0 13px rgba(102,206,244,.2); }
  51% { transform: scale(1.065); box-shadow: 0 0 19px rgba(220,164,86,.22); }
  58% { transform: scale(1); box-shadow: 0 0 0 0 rgba(102,206,244,0); }
}
@keyframes portal-beacon-ring {
  0%, 36%, 100% { transform: scale(.95); opacity: 0; }
  41% { transform: scale(1.18); opacity: .58; }
  58% { transform: scale(1.58); opacity: 0; }
}
@keyframes portal-beacon-core {
  0%, 36%, 100% { opacity: .8; transform: scale(.88); }
  41% { opacity: 1; transform: scale(1.2); box-shadow: 0 0 24px rgba(102,206,244,1); }
  46% { opacity: .9; transform: scale(.96); }
  51% { opacity: 1; transform: scale(1.1); box-shadow: 0 0 20px rgba(220,164,86,.72); }
  58% { opacity: .8; transform: scale(.88); }
}
@keyframes portal-life-sweep {
  0%, 20% { left: -38%; opacity: 0; }
  29% { opacity: .92; }
  52%, 100% { left: 116%; opacity: 0; }
}
.portal-principle { display: grid; grid-template-columns: 92px 1fr; gap: 25px; padding: 42px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.principle-number { color: rgba(239,184,78,.22); font-family: Georgia, serif; font-size: 4.4rem; line-height: .9; }
.portal-principle p:last-child { max-width: 810px; margin: 17px 0 0; color: var(--muted); line-height: 1.7; }
.support-strip { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-top: 42px; padding: 25px 28px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(110deg, #0a2a40, #102c3d 70%, #241d19); }
.support-strip div { display: grid; gap: 5px; }
.support-strip span { color: var(--muted); font-size: .78rem; }
.support-strip a { color: var(--gold-soft); font-size: .78rem; font-weight: 800; }
.portal-footer { display: flex; justify-content: space-between; gap: 20px; padding: 25px clamp(20px, 5vw, 76px); border-top: 1px solid var(--line); color: #737780; font-size: .69rem; }

@media (max-width: 850px) {
  .login-shell { width: min(100%, 540px); }
  .login-brand { margin: 0 auto 15px; }
  .login-stage { display: block; min-height: 0; overflow: visible; border: 0; border-radius: 0; background: none; box-shadow: none; }
  .login-story { display: none; }
  .login-card { border: 1px solid rgba(139,211,241,.25); border-radius: 26px; box-shadow: 0 30px 90px rgba(0,10,20,.5), inset 0 1px 0 rgba(185,235,255,.06); }
  .portal-hero { grid-template-columns: 1fr; }
  .session-panel { max-width: 470px; }
  .service-grid { grid-template-columns: 1fr; }
  .service-card { min-height: 255px; }
}
@media (max-width: 560px) {
  .auth-page { place-items: start center; padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .portal-brand { margin-bottom: 15px; }
  .portal-brand img { width: 60px; height: 44px; }
  .auth-card { padding: 27px 22px; border-radius: 20px; }
  .access-mark { margin-bottom: 22px; }
  .login-brand { gap: 10px; margin-bottom: 9px; }
  .login-brand img { width: 52px; height: 38px; border-radius: 10px; }
  .login-brand strong { font-size: 1rem; }
  .login-brand small { font-size: .6rem; }
  .login-card { padding: 18px; border-radius: 22px; }
  .login-card .access-heading { gap: 10px; margin-bottom: 11px; }
  .login-card .access-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .login-card h1 { margin-bottom: 7px; font-size: 1.82rem; line-height: 1.03; }
  .login-card .auth-intro { margin-bottom: 14px; font-size: .82rem; line-height: 1.42; }
  .login-card form { gap: 5px; }
  .login-card label { margin-top: 3px; font-size: .69rem; }
  .login-card input { min-height: 48px; }
  .login-card .form-message { min-height: 17px; margin: 0; font-size: .75rem; }
  .login-card .primary-button { min-height: 48px; }
  .login-card .access-note { grid-template-columns: auto 1fr; gap: 4px 9px; align-items: start; margin-top: 13px; padding-top: 12px; }
  .login-card .access-note strong { font-size: .75rem; white-space: nowrap; }
  .login-card .access-note span { font-size: .7rem; line-height: 1.35; }
  .login-shell .auth-footer { margin-top: 9px; font-size: .57rem; line-height: 1.35; }
  .portal-header { min-height: 70px; padding: 10px 15px; }
  .portal-brand.compact img { width: 48px; height: 35px; }
  .portal-brand.compact small, .secure-status { display: none; }
  .portal-brand.compact strong { font-size: .92rem; }
  .header-actions { gap: 8px; }
  .secondary-button { min-height: 37px; padding: 0 12px; }
  .portal-main { width: min(100% - 28px, 1180px); padding-top: 45px; }
  .portal-hero { gap: 27px; padding-bottom: 44px; }
  .session-panel { grid-template-columns: 1fr; }
  .session-panel strong { margin-bottom: 5px; }
  .section-heading { align-items: start; flex-direction: column; }
  .service-card { padding: 23px; }
  .portal-principle { grid-template-columns: 1fr; }
  .principle-number { font-size: 3.2rem; }
  .support-strip, .portal-footer { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 560px) and (min-height: 740px) {
  .auth-page { place-items: center; }
}
@media (min-width: 851px) and (max-height: 780px) {
  .auth-page { padding-top: 16px; padding-bottom: 16px; }
  .login-brand { margin-bottom: 10px; }
  .login-brand img { width: 60px; height: 44px; }
  .login-stage { min-height: 520px; }
  .login-story { padding: 34px 40px; }
  .login-story h2 { margin: 13px 0 15px; font-size: clamp(2.45rem, 4vw, 3.5rem); }
  .trust-list { gap: 11px; margin: 23px 0; }
  .login-card { padding: 27px 34px; }
  .login-card .auth-intro { margin-bottom: 17px; }
  .login-card .access-note { margin-top: 15px; padding-top: 13px; }
  .login-shell .auth-footer { margin-top: 9px; }
}
@media (max-width: 850px) and (max-height: 780px) and (min-width: 561px) {
  .auth-page { place-items: start center; padding-top: 14px; padding-bottom: 14px; }
  .login-brand { margin-bottom: 10px; }
  .login-card { padding: 24px 28px; }
  .login-card .access-heading { margin-bottom: 12px; }
  .login-card .auth-intro { margin-bottom: 16px; }
  .login-card .access-note { margin-top: 14px; padding-top: 13px; }
  .login-shell .auth-footer { margin-top: 9px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
