:root {
    --ink: #17313a;
    --ink-soft: #52646a;
    --paper: #f6f7f2;
    --surface: #fffefa;
    --line: #dce2dc;
    --line-dark: #c5d0c8;
    --evergreen: #25705b;
    --evergreen-dark: #155244;
    --evergreen-pale: #e5f0e9;
    --danger: #9c4e47;
    font-family: Manrope, sans-serif;
    color: var(--ink);
    background: var(--paper);
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; }

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(340px, 1fr) minmax(440px, 1fr);
}

.auth-intro {
    min-height: 100vh;
    padding: clamp(32px, 6vw, 88px);
    display: flex;
    flex-direction: column;
    color: #edf3ed;
    background: var(--ink);
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: inherit;
    text-decoration: none;
    width: max-content;
}

.auth-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 50%;
    font-family: Newsreader, serif;
    font-size: 23px;
}

.auth-brand strong { display: block; letter-spacing: .1em; font-size: 15px; }
.auth-brand small { display: block; color: #b8cabe; font-size: 11px; margin-top: -2px; }

.auth-intro-copy { max-width: 530px; margin: auto 0; }
.auth-intro-copy > p:first-child { margin: 0 0 18px; color: #b8cabe; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.auth-intro h1 {
    margin: 0;
    max-width: 12ch;
    font-family: Newsreader, serif;
    font-size: clamp(42px, 5vw, 68px);
    font-weight: 500;
    letter-spacing: -.04em;
    line-height: .98;
}

.auth-rule { display: block; width: 68px; height: 1px; margin: 30px 0 22px; background: #9bbdaa; }
.auth-support { max-width: 43ch; margin: 0; color: #c2d2c7; font-size: 16px; line-height: 1.7; }
.auth-footnote { margin: 42px 0 0; color: #aebeb5; font-size: 13px; }

.auth-panel {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
    background: var(--paper);
}

.auth-card {
    width: min(100%, 430px);
    padding: clamp(26px, 5vw, 46px);
    background: var(--surface);
    border: 1px solid var(--line-dark);
    border-radius: 16px;
    box-shadow: 0 18px 42px rgba(25, 52, 44, .09);
}

.auth-card-head p { margin: 0 0 10px; color: var(--evergreen-dark); font-size: 13px; font-weight: 800; }
.auth-card-head h2 { margin: 0 0 10px; font-family: Newsreader, serif; font-size: 38px; font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.auth-card-head span, .auth-help { color: var(--ink-soft); font-size: 14px; line-height: 1.6; }

.auth-form { display: grid; gap: 20px; margin-top: 34px; }
.auth-field { display: grid; gap: 8px; }
.auth-field label, .auth-check { color: var(--ink); font-size: 14px; font-weight: 700; }
.auth-label-row { display: flex; justify-content: space-between; gap: 16px; }
.auth-label-row a { color: var(--evergreen-dark); font-size: 13px; font-weight: 800; text-underline-offset: 4px; }

.auth-field input {
    min-height: 48px;
    width: 100%;
    border: 1px solid var(--line-dark);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    padding: 12px 13px;
    font: inherit;
    font-size: 16px;
    outline: none;
}

.auth-field input::placeholder { color: #798980; }
.auth-field input:focus { border-color: var(--evergreen); box-shadow: 0 0 0 3px rgba(37, 112, 91, .14); }
.password-control { position: relative; }
.password-control input { padding-right: 90px; }
.password-toggle { position: absolute; top: 50%; right: 8px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--evergreen-dark); cursor: pointer; transform: translateY(-50%); }
.password-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.password-toggle-eye-off { display: none; }
.password-toggle[aria-pressed="true"] .password-toggle-eye { display: none; }
.password-toggle[aria-pressed="true"] .password-toggle-eye-off { display: block; }
.password-toggle:hover, .password-toggle:focus-visible { background: var(--evergreen-pale); outline: none; }
.auth-feedback { position: fixed; z-index: 10; top: 24px; right: 24px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 11px; width: min(420px, calc(100vw - 36px)); padding: 14px; border-radius: 12px; box-shadow: 0 16px 38px rgba(25, 52, 44, .18); animation: feedback-enter .24s ease-out; }
.auth-feedback p { margin: 1px 0 0; font-size: 13px; font-weight: 700; line-height: 1.45; }
.auth-feedback-mark { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 14px; font-weight: 800; }
.auth-feedback-mark svg, .auth-feedback-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.auth-feedback-error { color: #7e332d; background: #fff3f1; border: 1px solid #e9bdb8; }
.auth-feedback-error .auth-feedback-mark { color: #fff; background: var(--danger); }
.auth-feedback-success { color: var(--evergreen-dark); background: var(--evergreen-pale); border: 1px solid #b9d5c4; }
.auth-feedback-success .auth-feedback-mark { color: #fff; background: var(--evergreen); }
.auth-feedback-close { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: currentColor; cursor: pointer; }
.auth-feedback-close:hover, .auth-feedback-close:focus-visible { background: rgba(23, 49, 58, .08); outline: none; }

.auth-check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.auth-check input { width: 18px; height: 18px; accent-color: var(--evergreen); }

.auth-submit {
    min-height: 48px;
    border: 1px solid var(--evergreen);
    border-radius: 10px;
    background: var(--evergreen);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: background .2s ease-out, transform .2s ease-out;
}

.auth-submit:hover, .auth-submit:focus-visible { background: var(--evergreen-dark); outline: none; }
.auth-submit:active { transform: translateY(1px); }
.auth-submit-loading { align-items: center; justify-content: center; gap: 9px; }
.auth-submit-loading[hidden] { display: none; }
.auth-submit-loading i { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: auth-spin .65s linear infinite; }
.auth-form.is-submitting { pointer-events: none; }
.auth-form.is-submitting .auth-submit { display: flex; align-items: center; justify-content: center; width: 100%; cursor: wait; background: var(--evergreen-dark); }
.auth-form.is-submitting .auth-submit-label { display: none; }
.auth-form.is-submitting .auth-submit-loading { display: inline-flex; }
@keyframes auth-spin { to { transform: rotate(1turn); } }
@keyframes feedback-enter { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.auth-help { margin: 25px 0 0; border-top: 1px solid var(--line); padding-top: 22px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) {
    * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media (max-width: 820px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-intro { min-height: auto; padding: 28px 24px; }
    .auth-intro-copy, .auth-footnote { display: none; }
    .auth-panel { min-height: calc(100vh - 94px); padding: 24px 18px; }
}

@media (max-width: 420px) {
    .auth-card { padding: 24px 20px; border-radius: 12px; }
    .auth-card-head h2 { font-size: 34px; }
    .auth-label-row { align-items: baseline; flex-wrap: wrap; gap: 6px 16px; }
    .auth-feedback { top: 18px; right: 18px; }
}
