:root {
    --canvas: #F7F5F0;
    --surface: #FFFFFF;
    --ink: #10231F;
    --ink-secondary: #455B55;
    --ink-muted: #687A75;
    --border: #DDE5E1;
    --teal-strong: #0F766E;
    --teal-deep: #0B4F49;
    --mint: #E6F7F3;
    --danger-soft: #FCEAE7;
    --focus: #087D73;
    --shadow-md: 0 12px 32px rgba(16, 35, 31, .10);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

* { box-sizing: border-box; }

html {
    background: var(--canvas);
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: "DM Sans", ui-sans-serif, system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

button,
input { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

a { color: var(--teal-strong); }

:where(a, button, input, [tabindex]):focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.auth-shell {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(390px, .9fr) minmax(520px, 1.1fr);
}

.brand-panel {
    position: relative;
    min-height: 100%;
    padding: max(40px, env(safe-area-inset-top)) 56px max(40px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--teal-deep);
    color: #FFFFFF;
}

.brand-panel::after {
    content: "";
    position: absolute;
    right: -170px;
    bottom: -170px;
    width: 430px;
    height: 430px;
    border: 1px solid rgba(184, 233, 222, .18);
    border-radius: 50%;
    box-shadow: 0 0 0 72px rgba(184, 233, 222, .045), 0 0 0 144px rgba(184, 233, 222, .025);
}

.brand-mark,
.mobile-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: "Space Grotesk", "DM Sans", sans-serif;
    font-size: 19px;
    font-weight: 700;
}

.brand-mark img,
.mobile-brand img { border-radius: 12px; }

.brand-story {
    position: relative;
    z-index: 1;
    width: min(100%, 540px);
    margin: auto 0;
    padding: 72px 0;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--teal-strong);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.brand-story .eyebrow { color: #B8E9DE; }

.brand-title {
    max-width: 570px;
    margin: 0;
    color: #FFFFFF;
    font-family: "Space Grotesk", "DM Sans", sans-serif;
    font-size: clamp(38px, 4.1vw, 58px);
    font-weight: 700;
    letter-spacing: -.045em;
    line-height: 1.03;
}

.brand-story ul {
    margin: 36px 0 0;
    padding: 0;
    display: grid;
    gap: 16px;
    list-style: none;
    color: #E6F7F3;
    font-weight: 600;
}

.brand-story li {
    position: relative;
    padding-left: 28px;
}

.brand-story li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .48em;
    width: 8px;
    height: 8px;
    border: 2px solid #75CFC2;
    border-radius: 50%;
}

.signal-path {
    position: absolute;
    top: 2px;
    right: 0;
    width: 160px;
    display: grid;
    gap: 12px;
    opacity: .5;
}

.signal-path span {
    position: relative;
    height: 2px;
    margin-left: auto;
    background: #75CFC2;
}

.signal-path span::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -1px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #B8E9DE;
    transform: translateY(-50%);
}

.signal-path span:nth-child(1) { width: 72px; }
.signal-path span:nth-child(2) { width: 112px; }
.signal-path span:nth-child(3) { width: 152px; }

.brand-note {
    position: relative;
    z-index: 1;
    margin: 0;
    color: #B8D8D2;
    font-size: 13px;
}

.auth-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 100%;
    padding: max(40px, env(safe-area-inset-top)) max(32px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(32px, env(safe-area-inset-left));
    display: grid;
    place-items: center;
}

.login-wrapper {
    width: min(100%, 440px);
    max-width: 100%;
}

.mobile-brand { display: none; }

.auth-header { margin-bottom: 28px; }

.auth-header h1 {
    margin: 0;
    font-family: "Space Grotesk", "DM Sans", sans-serif;
    font-size: clamp(32px, 4vw, 40px);
    letter-spacing: -.04em;
    line-height: 1.1;
}

.auth-header > p:last-child {
    margin: 10px 0 0;
    color: var(--ink-secondary);
}

.card {
    width: 100%;
    max-width: 100%;
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.form-group { margin-bottom: 20px; }

label {
    display: block;
    margin-bottom: 8px;
    color: var(--ink-secondary);
    font-size: 14px;
    font-weight: 700;
}

input[type="email"],
input[type="password"] {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border: 1px solid #C8D5D0;
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font-size: 16px;
    transition: border-color 160ms, box-shadow 160ms;
}

input[type="email"]::placeholder,
input[type="password"]::placeholder { color: var(--ink-muted); }

input[type="email"]:focus,
input[type="password"]:focus {
    border-color: var(--teal-strong);
    box-shadow: 0 0 0 3px rgba(8, 125, 115, .13);
}

.form-options {
    min-height: 44px;
    margin: -4px 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.remember-row {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.remember-row input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--teal-strong);
}

.remember-row label { margin: 0; font-weight: 500; }

.form-options a {
    padding: 11px 0;
    font-size: 14px;
    font-weight: 700;
    text-underline-offset: 3px;
}

.turnstile-wrap {
    min-height: 140px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.cf-turnstile { max-width: 100%; }

.btn,
.btn-biometric {
    width: 100%;
    min-height: 50px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    transition: background-color 160ms, border-color 160ms, box-shadow 160ms, transform 160ms;
}

.btn {
    border: 1px solid var(--teal-strong);
    background: var(--teal-strong);
    color: #FFFFFF;
    box-shadow: 0 7px 18px rgba(15, 118, 110, .18);
}

.btn:hover { background: var(--teal-deep); }

.btn-biometric {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid #C8D5D0;
    background: var(--surface);
    color: var(--ink);
}

.btn-biometric:hover {
    border-color: var(--teal-strong);
    background: var(--mint);
}

.btn-biometric svg { width: 20px; height: 20px; }

.btn:hover,
.btn-biometric:hover { transform: translateY(-1px); }

.btn:disabled,
.btn-biometric:disabled {
    cursor: wait;
    opacity: .68;
    transform: none;
    box-shadow: none;
}

.divider {
    margin: 18px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink-muted);
    font-size: 12px;
}

.divider::before,
.divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--border);
}

.error {
    display: none;
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid #E8A099;
    border-radius: var(--radius-sm);
    background: var(--danger-soft);
    color: #8B241D;
    font-size: 14px;
    font-weight: 600;
}

.footer {
    margin-top: 24px;
    color: var(--ink-secondary);
    font-size: 13px;
    text-align: center;
}

.footer p { margin: 8px 0 0; }

.footer a,
.footer button {
    font-weight: 700;
    text-underline-offset: 3px;
}

.footer button {
    min-height: 44px;
    padding: 8px;
    border: 0;
    background: none;
    color: var(--teal-strong);
    text-decoration: underline;
    cursor: pointer;
}

@media (max-width: 900px) {
    .auth-shell { display: block; }
    .brand-panel { display: none; }
    .auth-panel {
        min-height: 100vh;
        min-height: 100dvh;
        padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
        place-items: start center;
    }
    .mobile-brand {
        margin-bottom: clamp(40px, 9vh, 76px);
        display: flex;
    }
}

@media (max-width: 600px) {
    .auth-panel {
        padding-right: max(16px, env(safe-area-inset-right));
        padding-left: max(16px, env(safe-area-inset-left));
    }
    .auth-header { margin-bottom: 22px; }
    .auth-header h1 { font-size: 31px; }
    .card { padding: 20px; border-radius: var(--radius-md); }
}

@media (max-width: 360px) {
    .form-options { align-items: flex-start; flex-direction: column; gap: 0; }
}

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

    .btn:hover,
    .btn-biometric:hover { transform: none; }
}
