/* ─── AUTH OVERLAY ─────────────────────────────────────────────────────────── */
#authOverlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 16px;
}

#authOverlay.hidden {
    display: none;
}

/* ─── CARD ── */
.auth-card {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: authPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes authPop {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

/* ─── PROGRESS BAR ── */
.auth-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 40px 0;
    gap: 0;
}

.auth-step-wrap {
    display: flex;
    align-items: center;
    flex: 1;
}

.auth-step-wrap:last-child {
    flex: 0;
}

.auth-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    flex-shrink: 0;
    transition: background 0.3s, border-color 0.3s;
    border: 3px solid #e0e0e0;
    background: #f5f5f5;
    color: #999;
}

.auth-step-circle.active {
    background: #f7a800;
    border-color: #f7a800;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(247, 168, 0, 0.2);
}

.auth-step-circle.done {
    background: #22c55e;
    border-color: #22c55e;
    color: #fff;
}

.auth-step-circle.done::after {
    content: '✓';
    font-size: 17px;
    font-weight: 900;
}

.auth-step-circle.done .step-num {
    display: none;
}

.auth-step-line {
    flex: 1;
    height: 3px;
    background: #e0e0e0;
    margin: 0 4px;
    border-radius: 2px;
    transition: background 0.3s;
}

.auth-step-line.done {
    background: #22c55e;
}

.auth-step-labels {
    display: flex;
    justify-content: space-between;
    padding: 6px 28px 0;
}

.auth-step-label {
    font-size: 11px;
    font-weight: 600;
    color: #bbb;
    text-align: center;
    flex: 1;
    transition: color 0.3s;
    letter-spacing: 0.3px;
}

.auth-step-label.active {
    color: #f7a800;
}

.auth-step-label.done {
    color: #22c55e;
}

/* ─── BODY ── */
.auth-body {
    padding: 24px 36px 32px;
}

.auth-icon {
    font-size: 32px;
    margin-bottom: 4px;
    display: block;
}

.auth-title {
    font-size: 22px;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-title img.tg-icon {
    width: 28px;
    height: 28px;
}

.auth-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0 0 20px;
    line-height: 1.5;
}

/* ─── INFO BOX ── */
.auth-info-box {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #1e40af;
    line-height: 1.6;
}

.auth-info-box strong {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
}

.auth-info-box span {
    color: #3b82f6;
    font-weight: 500;
}

/* ─── INPUT GROUP ── */
.auth-input-group {
    margin-bottom: 6px;
}

.auth-input-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #444;
    margin-bottom: 8px;
}

.auth-input-label .at-sign {
    font-size: 16px;
    color: #3b82f6;
    font-weight: 800;
}

.auth-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    color: #1a1a2e;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafafa;
}

.auth-input:focus {
    border-color: #f7a800;
    box-shadow: 0 0 0 3px rgba(247, 168, 0, 0.15);
    background: #fff;
}

.auth-input-note {
    font-size: 11.5px;
    color: #999;
    margin-top: 6px;
    margin-bottom: 20px;
    display: block;
}

.auth-error {
    font-size: 12.5px;
    color: #ef4444;
    margin-top: 4px;
    margin-bottom: 12px;
    display: none;
    font-weight: 600;
}

.auth-error.show {
    display: block;
}

/* ─── BUTTONS ── */
.auth-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.auth-btn-primary {
    background: linear-gradient(135deg, #f7c948, #e8a000);
    color: #1a0a00;
    box-shadow: 0 4px 16px rgba(247, 168, 0, 0.4);
}

.auth-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(247, 168, 0, 0.5);
}

.auth-btn-primary:active { transform: scale(0.97); }

.auth-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.auth-btn-secondary {
    background: #f3f4f6;
    color: #444;
    font-size: 14px;
    margin-top: 10px;
    box-shadow: none;
    border: 2px solid #e5e7eb;
}

.auth-btn-secondary:hover {
    background: #e9eaec;
}

.auth-btn-tg {
    background: linear-gradient(135deg, #2aabee, #1a8fd1);
    color: #fff;
    box-shadow: 0 4px 16px rgba(42, 171, 238, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.auth-btn-tg:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(42, 171, 238, 0.5);
}

/* ─── WAITING STATE ── */
.auth-waiting {
    text-align: center;
    padding: 10px 0 4px;
}

.auth-waiting-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.auth-waiting-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f7a800;
    animation: dotPulse 1.2s ease-in-out infinite;
}

.auth-waiting-dots span:nth-child(2) { animation-delay: 0.2s; }
.auth-waiting-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40%            { transform: scale(1.2); opacity: 1; }
}

.auth-waiting-text {
    font-size: 15px;
    font-weight: 700;
    color: #444;
    margin-bottom: 4px;
}

.auth-waiting-sub {
    font-size: 12px;
    color: #999;
}

/* ─── SUCCESS STATE ── */
.auth-success-icon {
    font-size: 56px;
    display: block;
    text-align: center;
    margin-bottom: 8px;
    animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successPop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

.auth-success-title {
    font-size: 22px;
    font-weight: 900;
    color: #22c55e;
    text-align: center;
    margin-bottom: 6px;
}

.auth-success-sub {
    font-size: 14px;
    color: #666;
    text-align: center;
    margin-bottom: 20px;
}

/* ─── STEP 1 (site username) ── */
.auth-step1-card {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    padding: 36px 36px 32px;
    animation: authPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-step1-icon {
    font-size: 40px;
    display: block;
    text-align: center;
    margin-bottom: 8px;
}

.auth-step1-title {
    font-size: 22px;
    font-weight: 800;
    color: #1a1a2e;
    text-align: center;
    margin: 0 0 6px;
}

.auth-step1-sub {
    font-size: 14px;
    color: #666;
    text-align: center;
    margin: 0 0 24px;
    line-height: 1.5;
}

/* ─── RESPONSIVE ── */
@media (max-width: 480px) {
    .auth-body { padding: 20px 20px 24px; }
    .auth-progress { padding: 20px 20px 0; }
    .auth-step-labels { padding: 6px 12px 0; }
    .auth-step-label { font-size: 10px; }
    .auth-step1-card { padding: 24px 20px 24px; }
}
