/* ══════════════════════════════════════════════════════════════════
   Auth Page — Full CSS
   فونت: Vazirmatn (بارگذاری در قالب)
   ══════════════════════════════════════════════════════════════════ */

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

:root {
    --blue:        #3B82F6;
    --blue-dark:   #2563eb;
    --blue-light:  #60a5fa;
    --blue-pale:   #EBF4FF;
    --blue-border: #dbeafe;
    --text:        #1a1a2e;
    --muted:       #6b7280;
    --white:       #fff;
    --green:       #22c55e;
    --red:         #dc2626;
    --shadow:      0 8px 40px rgba(59, 130, 246, 0.13);
}

/* ── Full Page Layout ──────────────────────────────────────────── */
.auth-fullpage-body {
   font-family: Vazir, Tahoma, "DejaVu Sans", helvetica, arial, freesans, sans-serif;
    background: linear-gradient(135deg, #c7d9f8 0%, #e8f1fd 40%, #f0f6ff 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* ── Background Blobs ──────────────────────────────────────────── */
.auth-fullpage-body::before {
    content: '';
    position: fixed;
    top: -120px; right: -100px;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(59,130,246,0.18) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.auth-fullpage-body::after {
    content: '';
    position: fixed;
    bottom: -100px; left: -80px;
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(96,165,250,0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.bg-shape {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.07;
    background: var(--blue);
}
.bg-shape-1 { width: 200px; height: 200px; top: 15%; left: 8%; animation: floatA 7s ease-in-out infinite; }
.bg-shape-2 { width: 120px; height: 120px; top: 60%; right: 6%; animation: floatB 9s ease-in-out infinite; }
.bg-shape-3 { width: 80px;  height: 80px;  bottom: 20%; left: 20%; animation: floatA 11s ease-in-out infinite reverse; }

@keyframes floatA {
    0%,100% { transform: translateY(0px) rotate(0deg); }
    50%      { transform: translateY(-18px) rotate(8deg); }
}
@keyframes floatB {
    0%,100% { transform: translateY(0px) rotate(0deg); }
    50%      { transform: translateY(14px) rotate(-6deg); }
}

/* ── Card ──────────────────────────────────────────────────────── */
.auth-card {
    background: var(--white);
    border-radius: 28px;
    box-shadow: var(--shadow), 0 1px 0 rgba(255,255,255,0.8) inset;
    border: 1px solid rgba(219,234,254,0.8);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    position: relative;
    z-index: 10;
    animation: cardIn 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Header ────────────────────────────────────────────────────── */
.auth-header {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
    padding: 26px 28px 22px;
    position: relative;
    overflow: hidden;
}
.auth-header::before {
    content: '';
    position: absolute;
    top: -40px; left: 16px;
    width: 90px; height: 90px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.auth-header::after {
    content: '';
    position: absolute;
    bottom: -25px; right: -20px;
    width: 110px; height: 110px;
    background: rgba(255,255,255,0.07);
    border-radius: 50%;
}

/* Logo */
.logo-area {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 14px;
    position: relative; z-index: 1;
}
.logo-icon {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
   
    overflow: hidden;
    color:#fff;
}
.logo-icon img { width: 100%; height: 100%; object-fit: contain; }
.logo-text {
    font-size: 0.8rem;
    font-weight: 800;
    color: rgba(255,255,255,0.9);
    letter-spacing: 0.5px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 18px;
    position: relative; z-index: 1;
}
.tab-btn {
    flex: 1;
    padding: 8px;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(255,255,255,0.65);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s;
    border: none;
    background: transparent;
    font-family: Vazir, Tahoma, "DejaVu Sans", helvetica, arial, freesans, sans-serif;
}
.tab-btn.active {
    background: var(--white);
    color: var(--blue);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.auth-title {
    color: var(--white);
    font-size: 1.15rem;
    font-weight: 800;
    position: relative; z-index: 1;
    transition: all 0.3s;
}
.subtitle {
    color: rgba(255,255,255,0.72);
    font-size: 0.76rem;
    margin-top: 4px;
    position: relative; z-index: 1;
    display: flex;
    align-items: center;
    gap: 5px;
}
.ssl-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
    padding: 1px 7px;
    font-size: 0.68rem;
    font-weight: 700;
}

/* ── Body ──────────────────────────────────────────────────────── */
.auth-body { padding: 24px 28px 28px; }
.auth-body i{
    color:#3b82f6;
}

/* ── Steps ─────────────────────────────────────────────────────── */
.step { display: none; animation: stepIn 0.35s ease both; }
.step.active { display: block; }

@keyframes stepIn {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Step Dots */
.step-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 20px;
}
.step-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--blue-border);
    transition: all 0.3s;
}
.step-dot.active {
    background: var(--blue);
    width: 20px;
    border-radius: 4px;
}
.step-dot.done { background: var(--green); }

/* ── Inputs ────────────────────────────────────────────────────── */
.input-wrap {
    position: relative;
    margin-bottom: 12px;
}
.input-wrap .icon {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    pointer-events: none;
    line-height: 1;
}
.input-wrap input {
    width: 100%;
    padding: 12px 42px 12px 14px;
    border: 1.5px solid var(--blue-border);
    border-radius: 12px;
    font-family: Vazir, Tahoma, "DejaVu Sans", helvetica, arial, freesans, sans-serif;
    font-size: 0.87rem;
    background: #f8fbff;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    direction: rtl;
}
.input-wrap input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
    background: var(--white);
}
.input-wrap input::placeholder { color: #bbb; }
.input-wrap input.ltr { direction: ltr; text-align: right; }
.input-wrap input[type="password"] { padding-left: 44px; }

.toggle-pass {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--muted);
    border: none;
    background: none;
    padding: 2px 4px;
   font-family: Vazir, Tahoma, "DejaVu Sans", helvetica, arial, freesans, sans-serif;
    font-weight: 600;
}

/* Row 2 */
.row-2 { display: flex; gap: 10px; }
.row-2 .input-wrap { flex: 1; }

/* ── OTP ───────────────────────────────────────────────────────── */
.otp-group {
    display: flex;
    gap: 8px;
    justify-content: center;
    direction: ltr;
    margin-bottom: 12px;
}
.otp-input {
    width: 48px; height: 52px;
    border: 1.5px solid var(--blue-border);
    border-radius: 10px;
    font-family: Vazir, Tahoma, "DejaVu Sans", helvetica, arial, freesans, sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    text-align: center;
    color: var(--blue-dark);
    background: #f8fbff;
    outline: none;
    transition: all 0.2s;
    direction: ltr;
}
.otp-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
    background: var(--white);
}
.otp-input.filled {
    border-color: var(--blue);
    background: var(--blue-pale);
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn-primary {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
    border: none;
    border-radius: 12px;
    color: var(--white);
    font-family: Vazir, Tahoma, "DejaVu Sans", helvetica, arial, freesans, sans-serif;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(59,130,246,0.35);
    position: relative;
    overflow: hidden;
    margin-top: 4px;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(59,130,246,0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { background: #93c5fd; cursor: not-allowed; box-shadow: none; transform: none; }

.btn-ghost {
    width: 100%;
    padding: 11px;
    background: transparent;
    border: 1.5px solid var(--blue-border);
    border-radius: 12px;
    color: var(--blue);
    font-family: Vazir, Tahoma, "DejaVu Sans", helvetica, arial, freesans, sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}
.btn-ghost:hover { border-color: var(--blue); background: var(--blue-pale); }

.back-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    color: var(--muted);
    font-family: Vazir, Tahoma, "DejaVu Sans", helvetica, arial, freesans, sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-bottom: 14px;
    transition: color 0.2s;
}
.back-btn:hover { color: var(--blue); }

/* ── Helpers ───────────────────────────────────────────────────── */
.help-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 14px;
}
.help-row a { color: var(--blue); text-decoration: none; font-weight: 600; }
.help-row a:hover { text-decoration: underline; }

.remember-row {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 14px;
}
.remember-row input[type="checkbox"] {
    width: 15px; height: 15px;
    accent-color: var(--blue);
    cursor: pointer;
    flex-shrink: 0;
}

.otp-helper {
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
    margin-bottom: 14px;
}
.otp-timer { font-weight: 700; color: var(--blue); }

.resend-row {
    text-align: center;
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 10px;
}
.resend-btn {
    background: none;
    border: none;
    color: var(--blue);
    font-family: Vazir, Tahoma, "DejaVu Sans", helvetica, arial, freesans, sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
}
.resend-btn:disabled { color: var(--muted); text-decoration: none; cursor: not-allowed; }

.divider {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.72rem;
    color: #ccc;
    margin: 14px 0;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: #e5eef8; }

.user-id-preview {
    background: var(--blue-pale);
    border: 1px solid var(--blue-border);
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 0.82rem;
    color: var(--blue-dark);
    font-weight: 600;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.change-btn {
    background: none; border: none;
    color: var(--muted); font-size: 0.72rem;
    font-family: Vazir, Tahoma, "DejaVu Sans", helvetica, arial, freesans, sans-serif;
    cursor: pointer; font-weight: 600;
    text-decoration: underline;
}

/* ── Messages ──────────────────────────────────────────────────── */
.error-msg {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 0.78rem;
    color: var(--red);
    margin-bottom: 12px;
    display: none;
    align-items: center;
    gap: 6px;
}
.error-msg.show { display: flex; }

.info-box {
    background: var(--blue-pale);
    border: 1px solid var(--blue-border);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 0.78rem;
    color: #1d4ed8;
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.5;
}

/* ── Loading Spinner ───────────────────────────────────────────── */
.btn-spinner {
    display: inline-block;
    width: 15px; height: 15px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Success ───────────────────────────────────────────────────── */
.success-wrap {
    text-align: center;
    padding: 10px 0 6px;
}
.success-icon {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--green), #16a34a);
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    box-shadow: 0 4px 16px rgba(34,197,94,0.3);
    animation: popIn 0.5s cubic-bezier(0.34,1.56,0.64,1) both 0.1s;
}
@keyframes popIn {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.success-wrap h3 { font-size: 1.1rem; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.success-wrap p  { font-size: 0.82rem; color: var(--muted); line-height: 1.6; }

/* Terms */
.terms-row {
    font-size: 0.72rem;
    color: var(--muted);
    text-align: center;
    margin-top: 12px;
    line-height: 1.6;
}
.terms-row a { color: var(--blue); text-decoration: none; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .auth-fullpage-body { padding: 12px; }
    .auth-card  { border-radius: 22px; }
    .auth-header { padding: 20px 20px 18px; }
    .auth-body  { padding: 18px 20px 22px; }
    .otp-input  { width: 42px; height: 46px; font-size: 1.2rem; }
    .row-2      { flex-direction: column; gap: 0; }
}
