*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    min-height: 100dvh;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: linear-gradient(160deg, #0f172a 0%, #1e293b 45%, #0f172a 100%);
    color: #e2e8f0;
    -webkit-font-smoothing: antialiased;
}

.auth-page {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: clamp(20px, 5vw, 32px);
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.auth-brand {
    display: none;
}

.field {
    display: block;
    margin-bottom: 16px;
}

.field__label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.field__input {
    width: 100%;
    height: 52px;
    padding: 0 14px;
    font-size: 1.125rem;
    color: #f1f5f9;
    background: #0b1220;
    border: 1px solid #334155;
    border-radius: 10px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field__input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.field__input:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.field__input--code {
    letter-spacing: 0.35em;
    font-variant-numeric: tabular-nums;
    padding-right: 8px;
}

.field__hint {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    line-height: 1.35;
    color: #64748b;
}

.field__row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.field__row .field__input {
    flex: 1;
    min-width: 0;
}

.btn-clear {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border: 1px solid #334155;
    border-radius: 10px;
    background: #1e293b;
    color: #94a3b8;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-clear:hover:not(:disabled) {
    background: #334155;
    color: #f1f5f9;
    border-color: #475569;
}

.btn-clear:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn {
    display: block;
    width: 100%;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.15s, transform 0.1s;
}

.btn:active:not(:disabled) {
    transform: scale(0.98);
}

.btn--primary {
    height: 52px;
    margin-bottom: 16px;
    color: #0f172a;
    background: linear-gradient(135deg, #facc15 0%, #f59e0b 100%);
}

.btn--primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #fde047 0%, #fbbf24 100%);
}

.btn--primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.auth-status {
    min-height: 1.25rem;
    margin: 12px 0 0;
    font-size: 0.875rem;
    line-height: 1.4;
    text-align: center;
    color: #64748b;
}

.auth-status--ok {
    color: #4ade80;
}

.auth-status--error {
    color: #f87171;
}

@media (max-height: 520px) {
    .auth-page {
        align-items: flex-start;
        padding-top: 12px;
    }

    .auth-card {
        padding: 16px;
    }

    .auth-brand {
        margin-bottom: 12px;
        font-size: 1.125rem;
    }

    .field {
        margin-bottom: 12px;
    }

    .field__input,
    .btn-clear,
    .btn--primary {
        height: 46px;
    }

    .btn-clear {
        flex-basis: 46px;
        width: 46px;
    }
}
