* {
    box-sizing: border-box;
}

body.auth-page {
    --reset-ink: #172033;
    --reset-muted: #586579;
    --reset-line: #d8e0eb;
    --reset-blue: #2457c5;
    --reset-blue-dark: #1c469f;
    --reset-focus: rgba(37, 99, 235, 0.2);
    min-height: 100vh;
    margin: 0;
    padding: 72px 20px 28px;
    display: grid;
    place-items: center;
    color: var(--reset-ink);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(ellipse at 12% 8%, rgba(57, 133, 255, 0.13), transparent 34%),
        radial-gradient(ellipse at 92% 90%, rgba(68, 179, 153, 0.12), transparent 32%),
        linear-gradient(145deg, #f5f8fd 0%, #edf3fa 100%);
}

.auth-shell {
    width: min(100%, 486px);
    margin-inline: auto;
}

.brand {
    width: fit-content;
    margin: 0 auto 22px;
    display: flex;
    align-items: center;
    gap: 11px;
    color: #18243a;
    font-size: 25px;
    font-weight: 750;
    letter-spacing: -0.045em;
    text-decoration: none;
}

.brand img {
    display: block;
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 5px 10px rgba(23, 70, 184, 0.16));
}

.brand-accent {
    color: #2563c9;
}

.reset-card {
    padding: clamp(26px, 6vw, 42px);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(204, 215, 230, 0.9);
    border-radius: 22px;
    box-shadow: 0 22px 60px rgba(28, 49, 82, 0.12), 0 3px 10px rgba(28, 49, 82, 0.04);
}

.card-heading {
    margin-bottom: 27px;
    text-align: center;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 17px;
    color: #315a8e;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

.eyebrow svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: #39785a;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.reset-card h1 {
    margin: 0;
    color: #172033;
    font-size: clamp(27px, 5vw, 32px);
    font-weight: 740;
    letter-spacing: -0.04em;
    line-height: 1.2;
}

.intro {
    max-width: 365px;
    margin: 13px auto 0;
    color: var(--reset-muted);
    font-size: 15px;
    line-height: 1.65;
}

.notice {
    margin: 0 0 22px;
    padding: 13px 15px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.55;
}

.notice--success {
    color: #195b37;
    background: #eff9f2;
    border-color: #bee5c9;
}

.notice--info {
    color: #264b7c;
    background: #f0f6ff;
    border-color: #cbdcf6;
}

.notice--error {
    color: #8d2525;
    background: #fff1f0;
    border-color: #f3c4c0;
}

.reset-form {
    margin: 0;
}

.form-group {
    margin: 0 0 21px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #26344a;
    font-size: 14px;
    font-weight: 700;
}

.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    width: 20px;
    height: 20px;
    transform: translateY(-50%);
    fill: none;
    stroke: #718099;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
    pointer-events: none;
}

.email-input {
    display: block;
    width: 100%;
    min-height: 54px;
    padding: 13px 15px 13px 47px;
    color: #172033;
    background: #fff;
    border: 1px solid var(--reset-line);
    border-radius: 11px;
    box-shadow: inset 0 1px 2px rgba(22, 39, 65, 0.025);
    font: inherit;
    font-size: 15px;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.email-input::placeholder {
    color: #8a97aa;
    opacity: 1;
}

.email-input:hover {
    border-color: #9aacc4;
}

.email-input:focus-visible {
    border-color: #3975d4;
    outline: 3px solid var(--reset-focus);
    outline-offset: 1px;
}

.email-input:user-invalid {
    border-color: #c64b4b;
}

.email-input[aria-invalid="true"] {
    border-color: #c64b4b;
    background: #fffafa;
}

.field-help {
    margin: 8px 1px 0;
    color: #66748a;
    font-size: 12px;
    line-height: 1.5;
}

.submit-button {
    width: 100%;
    min-height: 54px;
    padding: 13px 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #fff;
    background: linear-gradient(135deg, #2866d2, #1f50b3);
    border: 1px solid #1e50b4;
    border-radius: 11px;
    box-shadow: 0 8px 18px rgba(37, 91, 190, 0.2);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.submit-button svg,
.back-link svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.submit-button:hover {
    background: linear-gradient(135deg, #225bbf, #193f91);
    box-shadow: 0 10px 22px rgba(37, 91, 190, 0.27);
    transform: translateY(-1px);
}

.submit-button:active {
    transform: translateY(0);
}

.submit-button:focus-visible,
.back-link:focus-visible,
.brand:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.42);
    outline-offset: 4px;
}

.back-link {
    width: fit-content;
    min-height: 42px;
    margin: 23px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #315a8e;
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
    transition: color 150ms ease;
}

.back-link:hover {
    color: #1746a0;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.page-note {
    margin: 19px 0 0;
    color: #738097;
    font-size: 12px;
    text-align: center;
}

body.dark-theme.auth-page {
    --reset-ink: #e8eee9;
    --reset-muted: #bdc9c1;
    --reset-line: #48564c;
    --reset-focus: rgba(142, 208, 169, 0.2);
    background:
        radial-gradient(ellipse at 12% 8%, rgba(45, 92, 153, 0.2), transparent 34%),
        radial-gradient(ellipse at 92% 90%, rgba(47, 111, 83, 0.2), transparent 32%),
        #151a17;
}

body.dark-theme .brand,
body.dark-theme .reset-card h1 {
    color: #e8eee9;
}

body.dark-theme .reset-card {
    background: rgba(32, 39, 35, 0.97);
    border-color: #37433b;
}

body.dark-theme .form-group label {
    color: #d8e2da;
}

body.dark-theme .email-input {
    color: #e8eee9;
    background: #252d28;
    border-color: #46534a;
}

body.dark-theme .email-input::placeholder,
body.dark-theme .field-help,
body.dark-theme .page-note {
    color: #a6b1a9;
}

body.dark-theme .input-icon {
    stroke: #aab8ad;
}

body.dark-theme .back-link,
body.dark-theme .eyebrow {
    color: #a8dfbd;
}

body.dark-theme .notice--success {
    color: #c2f0cf;
    background: #203b2b;
    border-color: #366448;
}

body.dark-theme .notice--info {
    color: #c7dcfb;
    background: #24364b;
    border-color: #3d5878;
}

body.dark-theme .notice--error {
    color: #ffc9c5;
    background: #472b2a;
    border-color: #76403d;
}

@media (max-width: 540px) {
    body.auth-page {
        min-height: 100svh;
        padding: 78px 15px 22px;
        place-items: center;
    }

    .brand {
        margin-bottom: 17px;
        font-size: 23px;
    }

    .brand img {
        width: 43px;
        height: 43px;
    }

    .reset-card {
        border-radius: 18px;
    }

    .card-heading {
        margin-bottom: 23px;
    }

    .submit-button {
        min-height: 52px;
        padding-inline: 12px;
        font-size: 14px;
    }
}

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