:root {
    --ocean-950: #03233f;
    --ocean-900: #052f57;
    --ocean-700: #07579e;
    --lagoon-500: #11b9c2;
    --lagoon-300: #54d7dc;
    --sea-glass: #eafbff;
    --foam: #f8fdff;
    --ink: #102f46;
    --muted: #607789;
    --line: #d6e8ef;
    --white: #fff;
    --shadow: 0 32px 90px rgba(3, 35, 63, .18);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { min-width: 320px; background: var(--sea-glass); }
body {
    min-height: 100vh;
    min-height: 100svh;
    padding: 24px;
    color: var(--ink);
    background:
        radial-gradient(circle at 4% 5%, rgba(84, 215, 220, .48), transparent 28rem),
        radial-gradient(circle at 96% 92%, rgba(21, 154, 215, .22), transparent 30rem),
        linear-gradient(145deg, #f8feff 0%, #eafbff 50%, #dff8fa 100%);
    font-family: Aptos, "Segoe UI", Arial, sans-serif;
}
button, input { font: inherit; }

.auth-shell {
    width: min(1160px, 100%);
    min-height: calc(100svh - 48px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(340px, .88fr) minmax(500px, 1.12fr);
    overflow: hidden;
    border: 1px solid rgba(7, 87, 158, .13);
    border-radius: 34px;
    background: rgba(255, 255, 255, .82);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.brand-panel {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 660px;
    padding: 54px 52px 46px;
    color: var(--white);
    background:
        linear-gradient(155deg, rgba(255, 255, 255, .09), transparent 36%),
        linear-gradient(145deg, var(--ocean-950) 0%, var(--ocean-700) 57%, #0798a6 100%);
}
.brand-panel::before, .brand-panel::after {
    content: "";
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
}
.brand-panel::before {
    width: 520px; height: 520px; right: -310px; top: -170px;
    border: 58px solid rgba(84, 215, 220, .16);
}
.brand-panel::after {
    width: 620px; height: 220px; left: -170px; bottom: -128px;
    border: 38px solid rgba(255, 255, 255, .11);
    transform: rotate(-8deg);
}
.brand-mark {
    width: 208px;
    min-height: 110px;
    display: grid;
    place-items: center;
    padding: 12px 18px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 22px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 18px 46px rgba(3, 35, 63, .24);
}
.brand-mark img { display: block; width: 100%; height: auto; max-height: 100px; object-fit: contain; }
.brand-copy { max-width: 385px; margin: 72px 0 auto; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: #b8f4f4;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.brand-title {
    max-width: 370px;
    font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    font-size: clamp(42px, 4.4vw, 66px);
    font-weight: 600;
    line-height: .98;
    letter-spacing: -.045em;
}
.brand-description { max-width: 350px; margin-top: 24px; color: rgba(255,255,255,.76); font-size: 16px; line-height: 1.7; }
.brand-assurance { display: flex; align-items: center; gap: 12px; margin-top: 42px; color: rgba(255,255,255,.82); font-size: 13px; font-weight: 650; }
.brand-assurance span { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.24); border-radius: 50%; background: rgba(255,255,255,.1); }
.brand-footer { margin-top: 52px; color: rgba(255,255,255,.56); font-size: 12px; }

.form-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 30px 54px 36px;
    background: rgba(255,255,255,.97);
}
.panel-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.back-link, .language-pill {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--white);
    color: var(--ocean-900);
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
    box-shadow: 0 7px 20px rgba(5,47,87,.06);
}
.back-link { padding: 0 16px; }
.language-pill { padding: 0 15px; cursor: default; }
.language-pill a { color: inherit; font-weight: 800; text-decoration: none; }
.language-pill a[aria-current="true"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.language-pill a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.form-wrap { width: min(500px, 100%); margin: auto; }
.form-heading { margin-bottom: 28px; }
.form-kicker { display: block; margin-bottom: 9px; color: var(--lagoon-500); font-size: 11px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.form-heading h1 { color: var(--ocean-950); font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif; font-size: clamp(36px,4vw,50px); font-weight: 600; line-height: 1.06; letter-spacing: -.035em; }
.form-heading p { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.6; }

.country-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; padding: 12px 14px; border: 1px solid #d8edf1; border-radius: 16px; background: #f2fbfc; }
.country-row small { color: var(--muted); font-size: 12px; font-weight: 650; }
.country-badge { display: inline-flex; align-items: center; gap: 8px; color: var(--ocean-900); font-size: 13px; font-weight: 800; }
.country-badge span { width: 9px; height: 9px; border-radius: 50%; background: var(--lagoon-500); box-shadow: 0 0 0 4px rgba(17,185,194,.13); }
.field { display: block; margin-bottom: 18px; }
.field-label { display: block; margin-bottom: 7px; color: var(--ocean-950); font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.control { position: relative; min-height: 56px; display: flex; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--white); transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.control:focus-within { border-color: var(--lagoon-500); box-shadow: 0 0 0 4px rgba(17,185,194,.13), 0 12px 26px rgba(5,47,87,.08); transform: translateY(-1px); }
.field-icon { width: 46px; flex: 0 0 46px; color: var(--ocean-700); text-align: center; font-size: 15px; }
.country-code { height: 26px; display: inline-flex; align-items: center; flex: 0 0 auto; margin-right: 12px; padding-right: 12px; border-right: 1px solid var(--line); color: var(--ocean-950); font-size: 13px; font-weight: 850; }
.control input { min-width: 0; flex: 1; padding: 16px 14px 16px 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; font-weight: 650; }
.control input::placeholder { color: #8a9ca9; font-weight: 500; }
.eye-button { width: 48px; height: 56px; flex: 0 0 48px; display: grid; place-items: center; border: 0; background: transparent; color: #6d8290; cursor: pointer; }
.eye-button:hover { color: var(--ocean-700); background: var(--sea-glass); }

.login-options { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 2px 0 24px; }
.remember-option { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; font-weight: 650; cursor: pointer; }
.remember-option input { width: 18px; height: 18px; accent-color: var(--lagoon-500); cursor: pointer; }
.forgot-link { color: var(--ocean-700); font-size: 12px; font-weight: 800; text-decoration: none; text-underline-offset: 3px; }
.forgot-link:hover { text-decoration: underline; }
.submit-button { width: 100%; min-height: 56px; display: flex; align-items: center; justify-content: center; gap: 12px; border: 0; border-radius: 16px; background: linear-gradient(115deg,var(--ocean-900),var(--ocean-700) 55%,var(--lagoon-500)); color: var(--white); font-size: 14px; font-weight: 850; letter-spacing: .025em; cursor: pointer; box-shadow: 0 16px 34px rgba(7,87,158,.25); transition: transform .2s ease, box-shadow .2s ease; }
.submit-button:hover { transform: translateY(-2px); box-shadow: 0 20px 40px rgba(7,87,158,.3); }
.submit-button:active { transform: translateY(0); }
.register-row { margin-top: 26px; color: var(--muted); text-align: center; font-size: 13px; }
.register-row a { margin-left: 4px; color: var(--ocean-700); font-weight: 850; text-underline-offset: 3px; }
.mobile-footer { display: none; margin-top: 28px; color: #8396a3; text-align: center; font-size: 11px; }

#responsePopup { position: fixed; left: 50%; bottom: 28px; z-index: 10001; width: min(420px,calc(100% - 32px)); display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border: 1px solid rgba(255,255,255,.14); border-radius: 15px; background: var(--ocean-950); color: var(--white); box-shadow: 0 18px 48px rgba(3,35,63,.3); font-size: 13px; font-weight: 650; line-height: 1.5; opacity: 0; pointer-events: none; transform: translate(-50%,20px); transition: opacity .25s ease, transform .25s ease; }
#responsePopup::before { content: "\f06a"; color: var(--lagoon-300); font-family: "Font Awesome 6 Free"; font-weight: 900; }
#responsePopup.show { opacity: 1; pointer-events: auto; transform: translate(-50%,0); }
#popupOverlay { position: fixed; inset: 0; z-index: 10000; background: rgba(3,35,63,.2); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
#popupOverlay.show { opacity: 1; pointer-events: auto; }
#customLoaderWrapper { position: fixed; inset: 0; z-index: 10002; display: grid; place-items: center; background: rgba(3,35,63,.55); backdrop-filter: blur(7px); transition: opacity .25s ease; }
#customLoaderWrapper.hidden { opacity: 0; pointer-events: none; }
.loader-card { min-width: 170px; display: grid; justify-items: center; gap: 16px; padding: 28px 32px; border: 1px solid rgba(255,255,255,.18); border-radius: 20px; background: rgba(3,35,63,.92); color: var(--white); box-shadow: 0 24px 64px rgba(3,35,63,.35); }
.loader-ring { width: 44px; height: 44px; border: 3px solid rgba(255,255,255,.18); border-top-color: var(--lagoon-300); border-radius: 50%; animation: spin .75s linear infinite; }
.loader-message { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
:focus-visible { outline: 3px solid rgba(84,215,220,.75); outline-offset: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 880px) {
    body { padding: 0; background: var(--foam); }
    .auth-shell { min-height: 100svh; grid-template-columns: 1fr; border: 0; border-radius: 0; box-shadow: none; }
    .brand-panel { min-height: 214px; padding: 60px 20px 40px; justify-content: flex-start; }
    .brand-panel::before { width: 360px; height: 360px; right: -230px; top: -160px; border-width: 42px; }
    .brand-panel::after { width: 420px; height: 150px; left: -120px; bottom: -96px; border-width: 26px; }
    .brand-mark { position: relative; z-index: 1; width: 148px; min-height: 72px; align-self: center; padding: 7px 11px; border-radius: 18px; }
    .brand-copy { margin: 13px auto 0; text-align: center; }
    .eyebrow { justify-content: center; margin: 0; font-size: 10px; }
    .eyebrow::before { width: 20px; }
    .brand-title, .brand-description, .brand-assurance, .brand-footer { display: none; }
    .form-panel { position: relative; z-index: 2; margin-top: -20px; padding: 20px 18px 30px; border-radius: 24px 24px 0 0; background: var(--white); }
    .panel-nav { position: absolute; z-index: 3; left: 16px; right: 16px; top: -184px; margin: 0; }
    .back-link, .language-pill { min-height: 42px; padding: 0 14px; border-color: rgba(255,255,255,.24); background: rgba(3,35,63,.24); color: var(--white); box-shadow: none; backdrop-filter: blur(10px); font-size: 12px; }
    .form-wrap { margin: 0 auto; }
    .form-heading { margin-bottom: 20px; }
    .form-heading h1 { font-size: 34px; }
    .form-heading p { margin-top: 7px; font-size: 13px; }
    .country-row { margin-bottom: 18px; padding: 11px 13px; }
    .field { margin-bottom: 15px; }
    .control { min-height: 54px; }
    .login-options { margin-bottom: 22px; }
    .mobile-footer { display: block; }
}

@media (max-width: 360px) {
    .form-panel { padding-inline: 15px; }
    .login-options { align-items: flex-start; }
    .remember-option, .forgot-link { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
