/* ============================================================
   AUTH PAGE — Login & Ro'yxatdan o'tish
   my.qrcodes.uz
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
    height: 100%;
    overflow-y: auto;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f172a;
    color: #1e293b;
    width: 100%;
    max-width: 380px;
    min-height: 100vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0 0 40px;
    overflow: visible;
}

/* ===== HEADER ===== */
.auth-header {
    width: 100%;
    max-width: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 20px 0;
    flex-direction: column;
    gap: 6px;
}
.auth-logo {
    font-size: 26px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.5px;
}
.auth-logo span { color: #4fc3f7; }
.auth-tagline {
    font-size: 12px;
    color: #475569;
    text-align: center;
}

/* ===== CARD ===== */
.auth-card {
    width: 100%;
    max-width: 380px;
    margin: 20px 0 0;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
    overflow: hidden;
}

/* ===== TABS ===== */
.auth-tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.auth-tab {
    flex: 1;
    padding: 14px 0;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #94a3b8;
    cursor: pointer;
    border: none;
    background: none;
    transition: all .2s;
    border-bottom: 3px solid transparent;
}
.auth-tab.active {
    color: #0f172a;
    border-bottom-color: #4fc3f7;
    background: #fff;
}

/* ===== TAB CONTENT ===== */
.tab-content { display: none; padding: 24px 22px; }
.tab-content.active { display: block; }

/* ===== FORM ===== */
.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
}
.field label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.field input {
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    color: #1e293b;
    outline: none;
    transition: border .15s, box-shadow .15s;
    font-family: inherit;
    background: #fff;
}
.field input:focus {
    border-color: #4fc3f7;
    box-shadow: 0 0 0 3px rgba(79,195,247,.15);
}
.field input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}
.field-hint {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 3px;
    line-height: 1.4;
}

/* ===== BUTTONS ===== */
.btn-primary {
    width: 100%;
    padding: 13px;
    background: #0f172a;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    margin-top: 4px;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-primary:hover:not(:disabled) { background: #1e293b; transform: translateY(-1px); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-secondary {
    width: 100%;
    padding: 12px;
    background: #f1f5f9;
    color: #475569;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
    margin-top: 8px;
}
.btn-secondary:hover { background: #e2e8f0; }

.btn-tg {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #229ED9 0%, #1a7fb5 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.btn-tg:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.btn-tg:disabled { opacity: .55; cursor: not-allowed; }

/* ===== STEPS ===== */
.step { display: none; }
.step.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity:0; transform: translateX(12px); } to { opacity:1; transform: none; } }

/* ===== STEP INDICATOR ===== */
.step-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
}
.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e2e8f0;
    transition: all .2s;
}
.step-dot.active  { background: #4fc3f7; width: 22px; border-radius: 4px; }
.step-dot.done    { background: #10b981; }
.step-title {
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 6px;
}
.step-desc {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 18px;
    line-height: 1.5;
}

/* ===== TG BOT CARD ===== */
.tg-bot-card {
    background: linear-gradient(135deg, #e0f7ff 0%, #e8f4fd 100%);
    border: 1px solid #b3e5fc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.tg-bot-card .tg-icon { font-size: 28px; flex-shrink: 0; }
.tg-bot-card .tg-info { flex: 1; }
.tg-bot-card .tg-name {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 3px;
}
.tg-bot-card .tg-steps {
    font-size: 12px;
    color: #475569;
    line-height: 1.6;
}
.tg-bot-card .tg-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    background: #229ED9;
    color: #fff;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: filter .15s;
}
.tg-bot-card .tg-link:hover { filter: brightness(1.1); }

/* ===== OTP INPUT ===== */
.otp-wrap {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 16px 0;
}
.otp-input {
    width: 46px;
    height: 54px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    outline: none;
    transition: all .15s;
    caret-color: #4fc3f7;
    color: #1e293b;
    font-family: 'Consolas', monospace;
}
.otp-input:focus { border-color: #4fc3f7; box-shadow: 0 0 0 3px rgba(79,195,247,.15); background: #f0fbff; }
.otp-input.filled { border-color: #10b981; background: #f0fdf4; }
.otp-input.error  { border-color: #ef4444; animation: shake .3s; }
@keyframes shake {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ===== RESEND ===== */
.resend-area { text-align: center; margin-top: 12px; }
.resend-btn {
    background: none;
    border: none;
    color: #4fc3f7;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font-family: inherit;
}
.resend-btn:disabled { color: #94a3b8; text-decoration: none; cursor: not-allowed; }
.resend-timer { font-size: 12px; color: #94a3b8; }

/* ===== SUCCESS ===== */
.success-wrap {
    text-align: center;
    padding: 10px 0 20px;
}
.success-icon {
    font-size: 52px;
    margin-bottom: 12px;
    animation: popIn .4s ease;
}
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }
.success-title {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
}
.success-sub { font-size: 13px; color: #64748b; margin-bottom: 20px; }

/* ===== ALERT ===== */
.alert {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
}
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info  { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert-hidden { display: none; }

/* ===== DIVIDER ===== */
.divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    color: #94a3b8;
    font-size: 12px;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* ===== FOOTER LINK ===== */
.auth-footer-link {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: #94a3b8;
}
.auth-footer-link a {
    color: #4fc3f7;
    font-weight: 700;
    text-decoration: none;
}

/* ===== PHONE PREVIEW ===== */
.phone-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: #1e293b;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

/* ===== BACK BUTTON ===== */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    margin-bottom: 16px;
    font-family: inherit;
    font-weight: 600;
}
.back-btn:hover { color: #1e293b; }

/* ===== PASSWORD TOGGLE ===== */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 17px;
    color: #94a3b8;
    padding: 4px;
}

/* ===== CHECKBOX ===== */
.check-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12.5px;
    color: #64748b;
    cursor: pointer;
    margin-top: 10px;
    line-height: 1.4;
}
.check-label input[type=checkbox] {
    accent-color: #0f172a;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    flex-shrink: 0;
}
.check-link {
    color: #0ea5e9;
    text-decoration: underline;
    text-decoration-color: rgba(14,165,233,.4);
}
.check-link:hover { color: #0284c7; }

/* ===== PAROL TIKLASH MODAL ===== */
.reset-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
    background: rgba(0,0,0,.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.reset-overlay.active { display: flex; }

.reset-box {
    background: #fff;
    border-radius: 20px;
    padding: 28px 24px 24px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,.4);
}

.reset-title {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    text-align: center;
    margin-bottom: 18px;
}

.reset-step { display: none; }
.reset-step.active { display: block; }

.reset-cancel-btn {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.reset-cancel-btn:hover { background: #f1f5f9; }
