:root {
    --bg-color: #0a0a0c;
    --surface: #1a1a1f;
    --border: rgba(255, 255, 255, 0.08);
    --text: #ffffff;
    --muted: #8b8b9e;
    --accent: #00f3ff;
    --error: #ff0055;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background: var(--bg-color);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: 'Noto Sans', 'Noto Sans Georgian', sans-serif;
}

.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 420px;
}

.hidden {
    display: none !important;
}

.auth-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px 32px 20px;
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.06);
}

.brand-wrap {
    text-align: center;
    margin-bottom: 20px;
}

.brand {
    display: inline-block;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--accent);
    text-transform: uppercase;
    text-shadow: 0 0 14px rgba(0, 243, 255, 0.35);
}

h1.login-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 36px;
    text-align: center;
}

.hint {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 22px;
    text-align: center;
}

.login-form-block {
    margin-bottom: 0;
    flex-shrink: 0;
}

.panel-step {
    margin-bottom: 8px;
}

.panel-step:last-child {
    margin-bottom: 0;
}

.form-field {
    margin-bottom: 18px;
}

.form-field label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.form-field.has-error label {
    color: var(--error);
}

.form-field.has-error .phone-wrap,
.form-field.has-error input:not([type="checkbox"]) {
    border-color: rgba(255, 0, 85, 0.55);
}

.phone-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-color);
}

.phone-prefix {
    font-weight: 700;
    color: var(--accent);
    font-size: 15px;
    flex-shrink: 0;
}

.phone-display {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 18px;
    letter-spacing: 0.06em;
    outline: none;
    min-width: 0;
    font-variant-numeric: tabular-nums;
}

.sms-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-color);
    color: var(--text);
    font-size: 22px;
    letter-spacing: 0.35em;
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sms-input:focus {
    outline: none;
    border-color: rgba(0, 243, 255, 0.45);
}

.sms-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.countdown {
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.08em;
    color: var(--accent);
}

.btn-ghost {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.btn-ghost:hover:not(:disabled) {
    color: var(--accent);
    border-color: rgba(0, 243, 255, 0.35);
}

.btn-ghost:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn-ghost.btn-ghost--ready {
    opacity: 1;
    color: var(--accent);
    border-color: rgba(0, 243, 255, 0.45);
    background: rgba(0, 243, 255, 0.1);
}

.btn-ghost.btn-ghost--ready:hover {
    color: #fff;
    border-color: rgba(0, 243, 255, 0.65);
    background: rgba(0, 243, 255, 0.18);
}

.error-msg {
    color: var(--error);
    font-size: 13px;
    margin-bottom: 12px;
    min-height: 1.2em;
    display: none;
}

.error-msg.visible {
    display: block;
}

.error-msg--sms-under {
    text-align: center;
    margin-top: 6px;
    margin-bottom: 14px;
    min-height: 0;
}

.btn-submit {
    width: 100%;
    margin-top: 6px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.btn-submit:hover:not(:disabled) {
    background: var(--accent);
    color: var(--bg-color);
}

.btn-submit:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn-text {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 0;
    border: none;
    background: none;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.btn-text:hover {
    color: var(--accent);
}

.lang-switcher {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.lang-switcher--below-card {
    width: 100%;
    margin-top: 24px;
    padding-top: 0;
    border-top: none;
}

.lang-btn {
    min-width: 44px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-color);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    border-color: rgba(0, 243, 255, 0.35);
    color: var(--text);
}

.lang-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.15);
}

.auth-footer {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 6px;
    flex-shrink: 0;
    margin-top: 24px;
    padding-top: 0;
    min-height: 0;
}

.register-prefix {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.register-link {
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    line-height: 1.4;
}

.register-link:hover {
    color: #fff;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 12, 0.88);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
    overflow-y: auto;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px 28px 28px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.45);
}

.modal-wide {
    max-width: 480px;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.modal-header .modal-title {
    flex: 1;
    margin: 0;
    padding: 0;
    min-width: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
}

.modal-back {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--accent);
    cursor: pointer;
    padding: 0;
}

.modal-back:hover {
    background: rgba(0, 243, 255, 0.12);
    color: #fff;
}

.modal-back-icon {
    display: block;
    width: 20px;
    height: 20px;
}

.modal-header-spacer {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    pointer-events: none;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-field-checkbox .checkbox-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.45;
    color: var(--muted);
    cursor: pointer;
}

.form-field-checkbox input {
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.inline-link {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.inline-link:hover {
    color: #fff;
}

.form-field input:not([type="checkbox"]) {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-color);
    color: var(--text);
    font-size: 15px;
}

.form-field input:focus {
    outline: none;
    border-color: rgba(0, 243, 255, 0.45);
}

.back-link {
    display: block;
    margin-top: 20px;
    text-align: center;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
}

.back-link:hover {
    color: var(--accent);
}
