:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --line: #d9d9d9;
    --line-strong: #bfbfbf;
    --text: #161616;
    --muted: #6b6b6b;
    --soft: #f6f6f6;
    --danger: #b42318;
    --shadow: 0 16px 48px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
    font: inherit;
}

.page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px 16px;
}

.auth-shell {
    width: min(100%, 360px);
}

.mark {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.mark-logo {
    display: block;
    width: 112px;
    height: auto;
}

.auth-header {
    margin-bottom: 20px;
    text-align: center;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    margin: 0 0 14px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(180, 35, 24, 0.1);
    color: var(--danger);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.auth-header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 650;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.auth-header p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.alert {
    display: none;
    margin-bottom: 14px;
    border: 1px solid rgba(180, 35, 24, 0.18);
    border-radius: 10px;
    background: rgba(180, 35, 24, 0.06);
    color: var(--danger);
    padding: 12px 14px;
    line-height: 1.45;
}

.alert.is-visible {
    display: block;
}

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

.field {
    display: grid;
    gap: 6px;
}

.field span {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 500;
}

.field input {
    width: 100%;
    height: 52px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field input:focus {
    outline: none;
    border-color: var(--line-strong);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.captcha-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.captcha-image {
    display: block;
    width: 132px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.text-link {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.primary-button {
    appearance: none;
    height: 52px;
    border: 0;
    border-radius: 8px;
    background: #111111;
    color: #ffffff;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
}

.primary-button:hover {
    background: #222222;
}

.footer-row {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 18px;
}

.language-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.9rem;
    min-width: 70px;
    padding: 0;
    text-decoration: none;
}

.language-button:hover {
    color: var(--text);
}

.language-button.active {
    color: var(--text);
}

@media (max-width: 480px) {
    .page {
        padding: 18px 14px;
    }

    .auth-shell {
        width: 100%;
    }

    .mark {
        margin-bottom: 20px;
    }

    .mark-logo {
        width: 96px;
    }

    .auth-badge {
        min-height: 32px;
        padding: 0 12px;
        font-size: 0.84rem;
    }

    .auth-header h1 {
        font-size: 1.72rem;
    }

    .auth-header p {
        font-size: 0.9rem;
    }

    .field input,
    .primary-button {
        height: 48px;
    }

    .captcha-row {
        align-items: stretch;
        flex-direction: column;
    }

    .captcha-image {
        width: 100%;
        max-width: 160px;
    }

    .footer-row {
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 380px) {
    .auth-header h1 {
        font-size: 1.52rem;
    }
}
