/* ============================================================
   auth.css — стили страницы регистрации/авторизации
   ============================================================ */

:root {
    --bg: #f5f6f0;
    --panel: #e0f0de;
    --card: #fff;
    --text: #20372d;
    --muted: #78877e;
    --green: #146c54;
    --accent: #acd9b9;
    --border: #dce5da;
    --deep: #1a2d25;
}

html.dark {
    --bg: #101d19;
    --panel: #284632;
    --card: #1a2b25;
    --text: #edf3eb;
    --muted: #aab9af;
    --green: #acd9b9;
    --accent: #acd9b9;
    --border: #364a3e;
    --deep: #1a2b25;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    transition: background .25s, color .25s;
}

button, input { font: inherit; }
button, a { cursor: pointer; }
a { color: inherit; text-decoration: none; }

body.preload .auth-card { opacity: 0; }
.auth-card { transition: opacity 0.25s ease-in-out; }

/* ================= LAYOUT ================= */
.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(420px, 39%) 1fr;
}

.sidebar {
    background: var(--panel);
    padding: 48px clamp(30px, 3.35vw, 64px);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.brand {
    font-size: 23px;
    font-weight: 800;
    color: var(--green);
    letter-spacing: -.5px;
}

.kicker {
    font-size: 11px;
    font-weight: 800;
    color: var(--green);
    text-transform: uppercase;
    margin: 28px 0;
}

h1 {
    font-size: clamp(38px, 3.4vw, 54px);
    line-height: 1.28;
    letter-spacing: -1.3px;
    margin: 0 0 24px;
    max-width: 540px;
}

.intro {
    font-size: 17px;
    line-height: 1.5;
    color: var(--muted);
    max-width: 500px;
    margin: 0;
}

.cat-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    min-height: 300px;
    padding: 24px 0;
}

.cat {
    width: min(310px, 80%);
    height: auto;
}

.next {
    background: var(--deep);
    color: var(--text);
    border-radius: 22px;
    padding: 25px 27px;
    margin-top: 10px;
}

.next .eyebrow {
    font-size: 10px;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    margin: 0 0 14px;
}

.next h2 {
    font-size: 21px;
    margin: 0 0 12px;
}

.next p {
    font-size: 14px;
    color: var(--muted);
    margin: 0 0 12px;
}

.next small {
    font-size: 12px;
    color: var(--accent);
}

.sidebar-note {
    font-size: 16px;
    line-height: 1.45;
    margin: 26px 0 0;
    font-weight: 550;
}

/* ================= MAIN ================= */
.main {
    padding: 48px clamp(28px, 5vw, 90px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.topbar {
    width: min(100%, 680px);
    margin: 0 auto 24px;
}

.back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    height: 48px;
    padding: 0 22px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--card);
    font-size: 14px;
    font-weight: 650;
}

.auth-card {
    width: min(100%, 680px);
    margin: 0 auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 42px 40px;
    box-shadow: 0 8px 30px rgba(20, 50, 35, .025);
}

.auth-card h2 {
    font-size: 34px;
    line-height: 1.2;
    letter-spacing: -.7px;
    margin: 0 0 18px;
}

.subtitle {
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 22px;
}

.tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: var(--bg);
    padding: 4px;
    border-radius: 15px;
    margin-bottom: 18px;
}

.tab {
    height: 48px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: transparent;
    color: var(--text);
    font-weight: 700;
}

.tab.active {
    background: var(--green);
    color: white;
    border-color: var(--green);
}

html.dark .tab.active {
    color: #183b29;
}

.field {
    display: block;
    margin: 0 0 20px;
}

.field > span {
    display: block;
    font-size: 13px;
    font-weight: 550;
    margin-bottom: 9px;
}

.input-wrap { position: relative; }

input[type=text],
input[type=email],
input[type=password] {
    width: 100%;
    height: 51px;
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--card);
    color: var(--text);
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input::placeholder {
    color: var(--muted);
    opacity: 1;
}

input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 13%, transparent);
}

.password-input {
    padding-right: 92px !important;
}

.show-pass {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: none;
    color: var(--green);
    font-size: 12px;
    font-weight: 700;
    padding: 6px;
}

.helper {
    font-size: 11px;
    color: var(--muted);
    margin: -9px 0 18px;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    margin: 4px 0 18px;
}

.check-row input {
    accent-color: var(--green);
    margin-top: 2px;
}

.submit {
    width: 100%;
    height: 49px;
    border: 0;
    border-radius: 13px;
    background: var(--green);
    color: white;
    font-size: 14px;
    font-weight: 750;
    margin-top: 0;
}

html.dark .submit {
    color: #183b29;
}

.switch-link {
    display: inline-block;
    color: var(--green);
    font-size: 13px;
    font-weight: 600;
    margin-top: 17px;
}

.forgot {
    margin-top: 26px;
}

.forgot h3 {
    font-size: 18px;
    margin: 0 0 20px;
}

.forgot p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
    margin: 0 0 20px;
}

.outline {
    width: 100%;
    height: 49px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: transparent;
    color: var(--text);
    font-weight: 700;
}

.message {
    display: none;
    padding: 11px 13px;
    margin: 0 0 16px;
    border-radius: 10px;
    background: var(--panel);
    color: var(--text);
    font-size: 13px;
    transition: background 0.2s, color 0.2s;
}

.message.show { display: block; }

/* ================= RECOVERY MODAL ================= */
.verify-intro { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 54px 0 18px; }
.verify-field { display: block; margin: 0 0 24px; }
.verify-field > span { display: block; font-size: 13px; margin-bottom: 9px; }
.verify-field input { background: var(--bg) !important; }
.verify-hint { font-size: 12px; color: var(--muted); margin: -1px 0 18px; line-height: 1.5; }
.resend-demo { margin: 0 0 18px; }
.verify-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.verify-actions button { height: 49px; border-radius: 13px; font-weight: 700; }
.recovery-modal { max-height: calc(100vh - 40px); overflow-y: auto; }

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(13, 28, 21, .42);
    backdrop-filter: blur(3px);
}

.modal-backdrop.open { display: flex; }

.recovery-modal {
    width: min(640px, 100%);
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .18);
    position: relative;
    z-index: 10000;
}

.modal-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.modal-heading h2 {
    font-size: 24px;
    line-height: 1.25;
    margin: 0;
}

.modal-close {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: transparent;
    color: var(--text);
    font-size: 18px;
    font-weight: 600;
}

.modal-subtitle {
    font-size: 14px;
    color: var(--muted);
    margin: 0 0 22px;
}

.recovery-modal .field { margin-bottom: 24px; }

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.modal-actions button {
    height: 49px;
    border-radius: 13px;
    font-weight: 700;
}

.modal-full {
    width: 100%;
    height: 49px;
    border: 0;
    border-radius: 13px;
    background: var(--green);
    color: white;
    font-weight: 750;
}

html.dark .modal-full { color: #183b29; }

.modal-success {
    background: #e0f0de;
    border-radius: 16px;
    padding: 28px 20px;
    margin: 0 0 18px;
    color: #20372d;
}

html.dark .modal-success { background: #243a30; color: #ecf2e9; }

.success-check {
    font-size: 27px;
    font-weight: 900;
    color: #146c54;
    margin: 0 0 12px;
}

html.dark .success-check { color: #acd9b9; }

.modal-success h3 { font-size: 19px; margin: 0; }
.success-caption { font-size: 13px; color: var(--muted); margin: 0 0 20px; }

/* ================= АДАПТИВ ================= */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { min-height: auto; padding: 28px 28px 24px; }
    .kicker { margin: 20px 0 12px; }
    h1 { font-size: 39px; }
    .cat-wrap { min-height: 220px; max-height: 260px; }
    .cat { width: 210px; }
    .next { max-width: 600px; width: 100%; margin: 0 auto; }
    .sidebar-note { display: none; }
    .main { padding: 30px 20px 50px; }
}

@media (max-width: 540px) {
    .sidebar { padding: 22px 20px; }
    .brand { font-size: 20px; }
    h1 { font-size: 35px; }
    .intro { font-size: 15px; }
    .cat-wrap { min-height: 190px; }
    .cat { width: 185px; }
    .main { padding: 22px 14px 36px; }
    .topbar { margin-bottom: 16px; }
    .auth-card { padding: 27px 20px; border-radius: 22px; }
    .auth-card h2 { font-size: 29px; }
    .back { height: 44px; }

    .recovery-modal { padding: 24px 20px; border-radius: 20px; }
    .modal-heading h2 { font-size: 22px; }
    .modal-actions { gap: 10px; }
    .modal-actions button { font-size: 13px; }
    .verify-intro { margin-top: 34px; }
    .verify-actions { gap: 10px; }
    .verify-actions button { font-size: 13px; }
}