:root {
    --orange: #f76300;
    --orange-dark: #d95500;
    --ink: #151517;
    --ink-soft: #37373e;
    --muted: #727274;
    --line: rgba(177, 178, 181, .4);
    --field: rgba(189, 189, 201, .2);
    --surface: #fff;
    --background: #f7f9fc;
}

* { box-sizing: border-box; }

html {
    min-height: 100%;
    font-family: Manrope, Inter, "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background: var(--background);
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 12% 8%, rgba(247, 99, 0, .16), transparent 30rem),
        radial-gradient(circle at 88% 92%, rgba(220, 227, 234, .9), transparent 34rem),
        linear-gradient(145deg, #fff 0%, #f7f9fc 55%, #ebeef2 100%);
}

a { color: var(--orange); font-weight: 700; text-decoration: none; }
a:hover { color: var(--orange-dark); }

.auth-brand {
    display: block;
    width: fit-content;
    margin-bottom: 32px;
}

.auth-brand-logo {
    display: block;
    width: 200px;
    max-width: 100%;
    height: auto;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    width: 100%;
    padding: 42px 20px;
}

.auth-card {
    width: min(100%, 480px);
    padding: 44px;
    background: var(--surface);
    border: 1px solid rgba(177, 178, 181, .32);
    border-radius: 24px;
    box-shadow:
        0 28px 80px rgba(21, 21, 23, .11),
        0 2px 8px rgba(21, 21, 23, .04);
}

.auth-card-wide { width: min(100%, 660px); }

.auth-kicker {
    margin-bottom: 9px;
    color: var(--orange);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    color: var(--ink-soft);
    font-size: clamp(31px, 5vw, 42px);
    line-height: 1.12;
    letter-spacing: -.04em;
}

h2 { margin: 25px 0 17px; font-size: 21px; }

.auth-intro,
.auth-hint {
    margin: 14px 0 30px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.55;
}

.auth-hint { margin-bottom: 22px; font-size: 14px; }
.auth-form { display: grid; gap: 18px; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.field {
    display: grid;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
}

.field-full { grid-column: 1 / -1; }

.password-control { position: relative; }
.password-control input { padding-right: 54px; }
.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 40px;
    min-height: 40px;
    height: 40px;
    padding: 0;
    display: grid;
    place-items: center;
    color: var(--muted);
    background: transparent;
    border-radius: 9px;
    font-size: 20px;
    line-height: 1;
    transform: translateY(-50%);
}
.password-toggle:hover {
    color: var(--orange-dark);
    background: rgba(247, 99, 0, .1);
    transform: translateY(-50%);
}
.password-toggle:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 1px;
}
.password-toggle svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.password-toggle[aria-pressed="true"]::after {
    content: "";
    position: absolute;
    width: 25px;
    border-top: 2px solid currentColor;
    transform: rotate(-45deg);
}
.field-link {
    justify-self: end;
    margin-top: -2px;
    font-size: 13px;
}

input,
select {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    color: var(--ink);
    font: inherit;
    font-weight: 500;
    background: var(--field);
    border: 1px solid transparent;
    border-radius: 12px;
    outline: none;
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

input::placeholder { color: #8e8d96; }

input:focus,
select:focus {
    background: #fff;
    border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(247, 99, 0, .12);
}

/* Поле, забракованное валидацией: подсвечиваем рамкой в тон .field-error,
   чтобы было видно, к какому именно полю относится сообщение. */
input[aria-invalid="true"],
select[aria-invalid="true"] {
    background: #fff;
    border-color: #d9705f;
    box-shadow: 0 0 0 4px rgba(178, 56, 40, .10);
}

input[aria-invalid="true"]:focus,
select[aria-invalid="true"]:focus {
    border-color: #b23828;
    box-shadow: 0 0 0 4px rgba(178, 56, 40, .18);
}

button {
    min-height: 52px;
    padding: 0 24px;
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
}

button:hover { transform: translateY(-1px); }
.primary-button {
    color: #fff;
    background: var(--orange);
    box-shadow: 0 10px 24px rgba(247, 99, 0, .22);
}
.primary-button:hover {
    background: var(--orange-dark);
    box-shadow: 0 12px 28px rgba(247, 99, 0, .28);
}
.secondary-button { color: var(--orange); background: rgba(247, 99, 0, .12); }

.auth-actions {
    display: grid;
    gap: 12px;
}

.auth-actions form,
.auth-actions button {
    width: 100%;
}

.button-link {
    min-height: 52px;
    display: grid;
    place-items: center;
    padding: 0 24px;
    border-radius: 12px;
    font-weight: 800;
    text-align: center;
}

.button-link:hover {
    color: #fff;
    background: var(--orange-dark);
}

.notice {
    margin: 20px 0;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
}

.notice-error { color: #a12d20; background: #fff0ed; border: 1px solid #ffd2ca; }
.notice-success { color: #25663a; background: #edf9f0; border: 1px solid #c8ead1; }
.field-hint { color: #6b6a73; font-weight: 500; line-height: 1.35; }

.field-error {
    color: #b23828;
    font-weight: 600;
    line-height: 1.35;
    /* Слот всегда занимает место, даже когда пуст, иначе соседние половинчатые поля
       (Пароль / Повторите пароль) в одной grid-строке "плывут" по высоте друг относительно друга,
       когда ошибка появляется только у одного из них. */
    display: block;
    min-height: 1.35em;
}

.auth-switch {
    margin: 24px 0 0;
    color: var(--muted);
    text-align: center;
    line-height: 1.5;
}

.auth-legal {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

.mail-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    color: #fff;
    background: var(--orange);
    border-radius: 15px;
    font-size: 24px;
}

hr { height: 1px; margin: 24px 0 0; background: var(--line); border: 0; }

@media (max-width: 620px) {
    .auth-page { align-items: start; padding: 16px 12px; }
    .auth-card { padding: 27px 22px; border-radius: 18px; }
    .auth-brand { margin-bottom: 26px; }
    .auth-brand-logo { width: 170px; }
    .form-grid { grid-template-columns: 1fr; }
    .field-full { grid-column: auto; }
}
