/* Kirish modali — mustaqil dizayn (barcha sahifalarda) */

.auth-modal-card {
    max-width: 440px;
    padding: 0;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.auth-modal-card .modal-close {
    top: 0.85rem;
    right: 0.85rem;
    z-index: 2;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    font-size: 1.25rem;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}

.auth-modal-card .modal-close:hover {
    background: var(--bg-card);
    color: var(--text);
}

.auth-header {
    text-align: center;
    padding: 1.75rem 1.5rem 1.25rem;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--primary, #e91e8c) 12%, var(--bg-card)) 0%,
        var(--bg-card) 100%
    );
    border-bottom: 1px solid var(--border);
}

.auth-header-logo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    margin-bottom: 0.65rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.auth-header h2 {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.auth-tagline {
    margin: 0;
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.auth-main {
    padding: 1.15rem 1.35rem 1.35rem;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem;
    margin-bottom: 1.1rem;
    padding: 0.28rem;
    border-radius: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}

.auth-tab {
    border: none;
    background: transparent;
    padding: 0.6rem 0.5rem;
    border-radius: 9px;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.auth-tab.active {
    background: var(--bg-card);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.auth-tab:hover:not(.active) {
    color: var(--text);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.auth-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrap .auth-input-icon {
    position: absolute;
    left: 0.85rem;
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    opacity: 0.7;
}

.auth-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.72rem 0.85rem 0.72rem 2.65rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input--plain {
    padding-left: 0.85rem;
}

.auth-input:focus {
    border-color: color-mix(in srgb, var(--primary, #e91e8c) 55%, var(--border));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #e91e8c) 18%, transparent);
}

.auth-input::placeholder {
    color: var(--text-muted);
    opacity: 0.65;
}

.auth-submit {
    margin-top: 0.15rem;
    padding: 0.78rem 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 12px;
}

.auth-status {
    min-height: 1.25rem;
    margin: 0.65rem 0 0;
    font-size: 0.82rem;
    text-align: center;
    line-height: 1.35;
}

.auth-status.ok { color: #22c55e; }
.auth-status.err { color: #ef4444; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.25rem 0 1rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-social {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}

.auth-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.68rem 0.5rem;
    font-size: 0.86rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.auth-social-btn:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--primary, #e91e8c) 40%, var(--border));
    background: var(--bg-card);
}

.auth-social-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.auth-social-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.auth-social-btn--google {
    border-color: color-mix(in srgb, #ea4335 25%, var(--border));
}

.auth-social-btn--tg {
    border-color: color-mix(in srgb, #229ed9 25%, var(--border));
}

.auth-more {
    margin-top: 0.85rem;
    text-align: center;
}

.auth-link-btn {
    background: none;
    border: none;
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary, #e91e8c);
    cursor: pointer;
    font-family: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-link-btn:hover {
    opacity: 0.85;
}

.auth-subflow {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 14px;
    border: 1px dashed var(--border);
    background: var(--bg-elevated);
}

.auth-subflow.hidden {
    display: none;
}

.auth-subflow-title {
    margin: 0 0 0.75rem;
    font-size: 0.88rem;
    font-weight: 700;
    text-align: center;
}

.auth-code-input {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    font-size: 1.35rem;
    letter-spacing: 0.28em;
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-family: inherit;
    margin-bottom: 0.65rem;
}

.auth-code-input:focus {
    outline: none;
    border-color: var(--primary, #e91e8c);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #e91e8c) 18%, transparent);
}

.auth-hint {
    margin: 0.5rem 0 0;
    font-size: 0.76rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.4;
}

.auth-subflow .btn {
    border-radius: 12px;
}

.auth-bot-link {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}

.auth-phone-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#auth-browser-step1-hint {
    margin: 0.5rem 0 0;
}

/* Login sahifa */
.page-login .auth-page-shell {
    min-height: calc(100vh - var(--nav-height) - var(--bottom-nav-h));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--nav-height) + 1.5rem) 1rem calc(var(--bottom-nav-h) + 2rem);
}

.page-login .auth-modal-card {
    width: 100%;
    max-width: 440px;
    position: relative;
}

.page-login .auth-modal-card .modal-close {
    display: none;
}

@media (max-width: 480px) {
    .auth-modal-card {
        max-width: 100%;
        border-radius: 18px;
    }
    .auth-header {
        padding: 1.5rem 1.15rem 1rem;
    }
    .auth-main {
        padding: 1rem 1.15rem 1.25rem;
    }
    .auth-social {
        grid-template-columns: 1fr;
    }
}
