:root {
    --green-950: #022c22;
    --green-900: #064e3b;
    --green-800: #065f46;
    --green-700: #047857;
    --green-600: #059669;
    --green-50: #ecfdf5;
    --slate-950: #0f172a;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --white: #ffffff;
    --red-700: #b91c1c;
    --red-50: #fef2f2;
    --shadow: 0 24px 70px rgba(15, 23, 42, 0.16);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--slate-100);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--slate-950);
    background: var(--slate-100);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

.auth-shell {
    display: grid;
    min-height: calc(100vh - 64px);
    grid-template-columns: minmax(0, 1fr);
}

.auth-story {
    position: relative;
    display: none;
    min-height: calc(100vh - 72px);
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: clamp(32px, 5vw, 72px);
    color: var(--white);
    background:
        radial-gradient(circle at 85% 12%, rgba(52, 211, 153, 0.25), transparent 28%),
        radial-gradient(circle at 15% 82%, rgba(16, 185, 129, 0.16), transparent 30%),
        linear-gradient(145deg, var(--green-950), var(--green-900) 58%, #073b30);
}

.auth-story::after {
    position: absolute;
    right: -150px;
    bottom: -175px;
    width: 420px;
    height: 420px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    box-shadow: 0 0 0 55px rgba(255, 255, 255, 0.025), 0 0 0 110px rgba(255, 255, 255, 0.02);
    content: "";
    pointer-events: none;
}

.auth-brand,
.mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    text-decoration: none;
}

.auth-brand {
    position: relative;
    z-index: 1;
    align-self: flex-start;
}

.auth-brand-mark {
    display: inline-grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    place-items: center;
    border-radius: 14px;
    color: var(--green-950);
    background: #6ee7b7;
    font-size: 0.84rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.auth-brand strong,
.mobile-brand strong {
    display: block;
    font-size: 1rem;
    letter-spacing: 0.08em;
}

.auth-brand small {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.72rem;
}

.story-content {
    position: relative;
    z-index: 1;
    width: min(100%, 620px);
    margin-block: 64px;
}

.eyebrow {
    margin: 0 0 14px;
    color: #6ee7b7;
    font-size: 0.73rem;
    font-weight: 850;
    letter-spacing: 0.16em;
}

.eyebrow.green {
    color: var(--green-700);
}

.story-content h1 {
    max-width: 16ch;
    margin: 0;
    font-size: clamp(2.35rem, 4.1vw, 4.25rem);
    line-height: 1.05;
    letter-spacing: -0.045em;
}

.story-content > p:not(.eyebrow) {
    max-width: 57ch;
    margin: 26px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1.04rem;
}

.story-content ul {
    display: grid;
    gap: 13px;
    margin: 30px 0 0;
    padding: 0;
    list-style: none;
}

.story-content li {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    color: rgba(255, 255, 255, 0.91);
}

.story-content li span {
    display: inline-grid;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    place-items: center;
    margin-top: 1px;
    border-radius: 50%;
    color: var(--green-950);
    background: #6ee7b7;
    font-size: 0.74rem;
    font-weight: 900;
}

.story-footer {
    position: relative;
    z-index: 1;
    margin: 0;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.76rem;
}

.auth-panel {
    display: grid;
    min-height: calc(100vh - 64px);
    place-items: start center;
    padding: 18px 12px;
    background: var(--white);
}

.auth-card {
    width: min(100%, 520px);
    padding: 22px 10px 32px;
    border: 0;
    border-radius: 0;
    background: var(--white);
    box-shadow: none;
}

.mobile-brand {
    display: none;
    margin-bottom: 28px;
}

.mobile-brand .auth-brand-mark {
    color: var(--white);
    background: var(--green-700);
}

.mobile-brand strong {
    color: var(--green-950);
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-bottom: 36px;
    padding: 5px;
    border-radius: 13px;
    background: var(--slate-100);
}

.auth-tabs a {
    padding: 10px 12px;
    border-radius: 9px;
    color: var(--slate-600);
    font-size: 0.9rem;
    font-weight: 750;
    text-align: center;
    text-decoration: none;
    transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.auth-tabs a:hover {
    color: var(--green-800);
}

.auth-tabs a.active {
    color: var(--green-900);
    background: var(--white);
    box-shadow: 0 2px 9px rgba(15, 23, 42, 0.08);
}

.form-heading h2,
.logout-card h1 {
    margin: 0;
    color: var(--slate-950);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.form-heading > p:last-child,
.logout-card > p:not(.eyebrow) {
    margin: 12px 0 0;
    color: var(--slate-600);
    font-size: 0.95rem;
}

.notice {
    margin-top: 22px;
    padding: 13px 15px;
    border: 1px solid;
    border-radius: 11px;
    font-size: 0.85rem;
}

.notice ul {
    margin: 6px 0 0;
    padding-left: 19px;
}

.notice.error {
    border-color: #fecaca;
    color: var(--red-700);
    background: var(--red-50);
}

.notice.success {
    border-color: #a7f3d0;
    color: var(--green-800);
    background: var(--green-50);
}

.auth-form {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

.field-group {
    display: grid;
    gap: 7px;
}

.field-group label {
    color: var(--slate-700);
    font-size: 0.84rem;
    font-weight: 750;
}

.field-group input {
    width: 100%;
    height: 50px;
    padding: 0 14px;
    border: 1px solid var(--slate-300);
    border-radius: 11px;
    outline: none;
    color: var(--slate-950);
    background: var(--white);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field-group input::placeholder {
    color: #94a3b8;
}

.field-group input:hover {
    border-color: #94a3b8;
}

.field-group input:focus {
    border-color: var(--green-600);
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.13);
}

.field-help,
.field-group small {
    margin: -1px 0 0;
    color: var(--slate-500);
    font-size: 0.76rem;
}

.auth-submit {
    display: inline-flex;
    min-height: 51px;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
    padding: 12px 20px;
    border: 0;
    border-radius: 11px;
    color: var(--white);
    background: linear-gradient(135deg, var(--green-700), var(--green-800));
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(4, 120, 87, 0.2);
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.auth-submit:hover {
    background: linear-gradient(135deg, var(--green-600), var(--green-700));
    box-shadow: 0 15px 29px rgba(4, 120, 87, 0.25);
    transform: translateY(-1px);
}

.auth-submit:active {
    transform: translateY(0);
}

.auth-submit:focus-visible,
.auth-tabs a:focus-visible,
.switch-copy a:focus-visible,
.cancel-link:focus-visible,
.auth-brand:focus-visible {
    border-radius: 8px;
    outline: 3px solid rgba(16, 185, 129, 0.35);
    outline-offset: 3px;
}

.switch-copy {
    margin: 25px 0 0;
    color: var(--slate-600);
    font-size: 0.88rem;
    text-align: center;
}

.switch-copy a {
    color: var(--green-700);
    font-weight: 800;
    text-decoration: none;
}

.switch-copy a:hover {
    text-decoration: underline;
}

.auth-help {
    margin: 24px 0 0;
    padding-top: 20px;
    border-top: 1px solid var(--slate-200);
    color: var(--slate-500);
    font-size: 0.76rem;
    text-align: center;
}

.logout-shell {
    display: grid;
    min-height: calc(100vh - 64px);
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 15% 15%, rgba(110, 231, 183, 0.28), transparent 27%),
        linear-gradient(145deg, var(--green-950), var(--green-900));
}

.logout-card {
    width: min(100%, 470px);
    padding: clamp(30px, 6vw, 52px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 25px;
    background: var(--white);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
    text-align: center;
}

.logout-card .auth-brand-mark {
    margin-bottom: 25px;
    color: var(--white);
    background: var(--green-700);
}

.logout-card form {
    display: grid;
    gap: 13px;
    margin-top: 30px;
}

.cancel-link {
    display: inline-flex;
    min-height: 45px;
    align-items: center;
    justify-content: center;
    color: var(--slate-600);
    font-size: 0.88rem;
    font-weight: 750;
    text-decoration: none;
}

.cancel-link:hover {
    color: var(--green-700);
}

@media (min-width: 541px) {
    .auth-panel {
        place-items: center;
        padding: 28px 18px;
        background:
            radial-gradient(circle at 90% 10%, rgba(16, 185, 129, 0.1), transparent 26%),
            var(--slate-100);
    }

    .auth-card {
        padding: clamp(30px, 5vw, 52px);
        border: 1px solid rgba(203, 213, 225, 0.75);
        border-radius: 26px;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: var(--shadow);
    }
}

@media (min-width: 981px) {
    .auth-shell {
        min-height: calc(100vh - 72px);
        grid-template-columns: minmax(420px, 0.95fr) minmax(520px, 1.05fr);
    }

    .auth-story {
        display: flex;
    }

    .auth-panel {
        min-height: calc(100vh - 72px);
        padding: clamp(28px, 5vw, 80px);
    }

    .logout-shell {
        min-height: calc(100vh - 72px);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
