/* راند ۱۱ — صفحات auth فایل main.css را لود نمی‌کنند؛ توکن‌ها باید همین‌جا باشند.
   پس‌زمینهٔ auth همیشه آبی است → متن همیشه سفید خالص. */
:root {
    --w: 255, 255, 255;
    --font-fa: 'Vazirmatn', Tahoma, sans-serif;
    --font-en: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
}

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

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background:
        radial-gradient(ellipse 80% 60% at 12% 8%, rgba(174, 208, 234, 0.82) 0%, transparent 55%),
        radial-gradient(ellipse 75% 55% at 88% 12%, rgba(168, 216, 245, 0.78) 0%, transparent 52%),
        linear-gradient(135deg, #8db6db 0%, #6d9bc9 48%, #5c8ab9 100%);
    background-attachment: fixed;
    font-family: var(--font-fa);
    color: rgb(var(--w));
}

body::before {
    content: '';
    position: fixed;
    inset: -15%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 55% 45% at 18% 28%, rgba(174, 208, 234, 0.50) 0%, transparent 68%),
        radial-gradient(ellipse 50% 40% at 82% 18%, rgba(200, 234, 250, 0.40) 0%, transparent 62%);
    animation: aurora-drift 16s ease-in-out infinite alternate;
}

@keyframes aurora-drift {
    0%   { transform: translate(0, 0) scale(1); opacity: 0.75; }
    100% { transform: translate(2%, -1.5%) scale(1.03); opacity: 1; }
}

.auth-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.auth-card {
    width: 420px;
    max-width: 100%;
    padding: 36px 32px;
    background: rgba(26, 80, 128, 0.72);
    backdrop-filter: blur(28px);
    border: 1px solid rgba(174, 208, 234, 0.35);
    border-radius: 20px;
    color: rgb(var(--w));
    text-align: center;
    box-shadow: 0 18px 50px rgba(20, 50, 80, 0.35), 0 0 40px rgba(174, 208, 234, 0.18);
}

.logo {
    font-size: 48px;
    margin-bottom: 12px;
}

h1 {
    font-size: 23px;
    font-weight: 900;
    margin-bottom: 8px;
    color: #ffffff;
    letter-spacing: -0.2px;
    text-shadow: 0 2px 14px rgba(126, 192, 238, 0.55), 0 1px 2px rgba(6, 24, 48, 0.45);
}

.subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 20px;
    line-height: 1.7;
    text-shadow: 0 1px 6px rgba(6, 24, 48, 0.35);
}

.auth-internet-notice {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(var(--w), 0.14);
    border: 1px solid rgba(var(--w), 0.28);
    text-align: right;
    font-size: 0.92rem;
    line-height: 1.65;
}

.auth-internet-notice strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.98rem;
}

.auth-internet-notice ul {
    margin: 6px 0;
    padding-right: 18px;
}

.auth-internet-notice__hint {
    margin-top: 6px;
    font-size: 0.82rem;
    opacity: 0.88;
}

.auth-internet-notice--offline {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.45);
}

.auth-internet-notice[hidden] {
    display: none !important;
}

.auth-card button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.network-status-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 10px 16px;
    background: linear-gradient(90deg, #b45309, #d97706);
    color: rgb(var(--w));
    text-align: center;
    font-size: 0.88rem;
    line-height: 1.5;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.network-status-banner[hidden] {
    display: none !important;
}

.photo-card {
    width: 100%;
    padding: 18px;
    margin: 10px 0 16px;
    border-radius: 18px;
    background: rgba(var(--w), 0.1);
    border: 1px solid rgba(var(--w), 0.22);
}

.photo-label {
    text-align: right;
    color: rgb(var(--w));
    margin-bottom: 12px;
    font-weight: 700;
    font-size: 15px;
}

.avatar-preview {
    width: 100%;
    min-height: 190px;
    border-radius: 18px;
    background: linear-gradient(135deg, #8db6db, #6d9bc9, #5c8ab9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgb(var(--w));
    font-size: 48px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(var(--w), 0.22);
}

.avatar-preview.default {
    background: linear-gradient(135deg, #4a8878, #487898, #3a6898);
}

.avatar-preview::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at top left, rgba(var(--w), 0.28), transparent 30%),
        radial-gradient(circle at bottom right, rgba(var(--w), 0.16), transparent 28%);
    pointer-events: none;
}

.avatar-preview span {
    position: relative;
    z-index: 1;
    font-size: 54px;
}

.avatar-preview img,
.avatar-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 14px;
}

.photo-actions button {
    width: auto;
    flex: 1 1 140px;
    margin-top: 0;
}

/* ─── ورودی‌ها ─── */
input,
select {
    width: 100%;
    margin: 7px 0;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(var(--w), 0.32);
    background: rgba(var(--w), 0.14);
    color: rgb(var(--w));
    font-family: var(--font-fa);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus {
    border-color: rgba(144, 220, 190, 0.85);
    background: rgba(var(--w), 0.18);
    box-shadow: 0 0 0 3px rgba(174, 208, 234, 0.28);
}

input::placeholder {
    color: rgba(var(--w), 0.58);
}

select {
    cursor: pointer;
}

select option {
    background: #1A5080;
    color: rgb(var(--w));
}

/* ─── دکمه‌ها ─── */
button {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--font-fa);
    font-size: 15px;
    font-weight: bold;
    transition: opacity 0.2s, transform 0.1s, background 0.2s, box-shadow 0.2s;
}

button:hover {
    opacity: 0.95;
}

button:active {
    transform: scale(0.98);
}

/* راند ۱۱: دکمهٔ اصلی — گرادیان عمیق + متن سفید (همیشه خوانا) */
button:not(.secondary):not(.guest) {
    background: linear-gradient(135deg, #4c86b8 0%, #38699a 55%, #2a5480 100%);
    color: #ffffff;
    box-shadow: 0 8px 22px rgba(10, 40, 70, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    text-shadow: 0 1px 2px rgba(6, 24, 48, 0.35);
}

button:not(.secondary):not(.guest):hover {
    box-shadow: 0 12px 28px rgba(10, 40, 70, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

button.secondary {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.38);
    margin-top: 8px;
    text-shadow: 0 1px 2px rgba(6, 24, 48, 0.30);
}

button.secondary:hover {
    background: rgba(255, 255, 255, 0.20);
    color: #ffffff;
}

button.guest {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1px solid rgba(180, 230, 210, 0.45);
    margin-top: 8px;
    text-shadow: 0 1px 2px rgba(6, 24, 48, 0.30);
}

/* ─── نوار قدرت رمز ─── */
.strength-bar {
    width: 100%;
    background: rgba(var(--w), 0.18);
    height: 6px;
    border-radius: 6px;
    margin-top: 6px;
    overflow: hidden;
}

#bar {
    height: 6px;
    width: 0%;
    border-radius: 6px;
    transition: width 0.3s, background 0.3s;
}

#strength-text,
.strength-text {
    font-size: 13px;
    color: rgba(var(--w), 0.85);
    margin: 5px 0 8px;
    text-align: right;
}

.strength-text.weak   { color: #fca5a5; }
.strength-text.medium { color: #fdba74; }
.strength-text.strong { color: #86efac; }

/* ─── پیام‌ها ─── */
.msg,
#msg {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    min-height: 20px;
    line-height: 1.6;
}

.msg.success,
#msg.success {
    background: rgba(34, 120, 70, 0.35);
    border: 1px solid rgba(134, 239, 172, 0.45);
    color: #bbf7d0;
}

.msg.error,
#msg.error {
    background: rgba(140, 30, 30, 0.35);
    border: 1px solid rgba(252, 165, 165, 0.45);
    color: #fecaca;
}

.msg.info,
#msg.info {
    background: rgba(30, 80, 140, 0.35);
    border: 1px solid rgba(147, 197, 253, 0.45);
    color: #bfdbfe;
}

/* ─── موبایل ─── */
@media (max-width: 480px) {
    .auth-card {
        width: 100%;
        padding: 28px 20px;
        border-radius: 16px;
    }

    .photo-actions button {
        flex: 1 1 100%;
    }
}

/* ═══════════════════════════════════════════════════════════════
   راند ۱۰ — افکت‌های سنگین ریاضی صفحات auth (بوم + کارت زنده)
   ═══════════════════════════════════════════════════════════════ */

#auth-fx {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.auth-container {
    position: relative;
    z-index: 1;
}

/* کارت ورود — ورود روی صحنه با فنر دوئولینگویی + هالهٔ ریاضی */
.auth-card {
    animation: auth-card-in 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    box-shadow: 0 24px 70px rgba(6, 24, 48, 0.45), 0 0 0 1px rgba(var(--w), 0.10), 0 0 90px rgba(126, 192, 238, 0.18);
}
@keyframes auth-card-in {
    from { opacity: 0; transform: translateY(34px) scale(0.94); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* لوگو — شناوری آرام + هاله */
.auth-card .logo {
    animation: auth-logo-float 3.6s ease-in-out infinite;
    filter: drop-shadow(0 6px 18px rgba(126, 192, 238, 0.45));
}
@keyframes auth-logo-float {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50%      { transform: translateY(-9px) rotate(2deg); }
}

/* دکمهٔ ورود — درخشش عبوری */
.auth-card button[type="submit"],
.auth-card .auth-submit {
    position: relative;
    overflow: hidden;
}
.auth-card button[type="submit"]::after,
.auth-card .auth-submit::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 46%;
    left: -60%;
    background: linear-gradient(105deg, transparent, rgba(var(--w), 0.5), transparent);
    transform: skewX(-18deg);
    animation: auth-shine 3.4s ease-in-out infinite;
    pointer-events: none;
}
@keyframes auth-shine {
    0%, 55%  { left: -60%; }
    85%, 100% { left: 130%; }
}

/* ورودی‌ها — فوکوس درخشان */
.auth-card input:focus {
    box-shadow: 0 0 0 4px rgba(126, 192, 238, 0.30), 0 8px 22px rgba(6, 24, 48, 0.25);
    transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
    .auth-card, .auth-card .logo, .auth-card button[type="submit"]::after, .auth-card .auth-submit::after {
        animation: none !important;
    }
    #auth-fx { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   راند ۱۱ — کارت ورود خفن‌تر: حلقهٔ گرادیانِ چرخان + شاین عنوان
   + نمادهای ریاضی شناور + فوتر برند
   ═══════════════════════════════════════════════════════════════ */

/* کارت — حلقهٔ گرادیانِ متحرک دور کارت (outline جادویی) */
.auth-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}
.auth-card::before {
    content: '';
    position: absolute;
    inset: -140%;
    z-index: -2;
    background: conic-gradient(from 0deg,
        transparent 0deg, rgba(126, 192, 238, 0.55) 60deg,
        transparent 120deg, rgba(144, 220, 190, 0.45) 190deg,
        transparent 250deg, rgba(196, 160, 255, 0.40) 320deg, transparent 360deg);
    animation: auth-ring-spin 7s linear infinite;
}
.auth-card::after {
    content: '';
    position: absolute;
    inset: 1.5px;
    z-index: -1;
    border-radius: 19px;
    background: linear-gradient(160deg, rgba(30, 86, 134, 0.90), rgba(20, 62, 100, 0.94));
    backdrop-filter: blur(28px);
}
@keyframes auth-ring-spin {
    to { transform: rotate(1turn); }
}

/* شاین عبوری روی سطح کارت */
.auth-card .shine-sweep {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
    border-radius: 20px;
}
.auth-card .shine-sweep::after {
    content: '';
    position: absolute;
    top: -60%;
    bottom: -60%;
    width: 34%;
    left: -45%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.14) 45%, transparent);
    transform: rotate(14deg);
    animation: auth-card-sweep 5.2s ease-in-out infinite;
}
@keyframes auth-card-sweep {
    0%, 58%  { left: -45%; }
    88%, 100% { left: 130%; }
}

/* عنوان — درخشش نبضی نرم */
.auth-card h1 {
    animation: auth-title-glow 3.4s ease-in-out infinite;
}
@keyframes auth-title-glow {
    0%, 100% { text-shadow: 0 2px 14px rgba(126, 192, 238, 0.45), 0 1px 2px rgba(6, 24, 48, 0.45); }
    50%      { text-shadow: 0 2px 24px rgba(150, 214, 250, 0.85), 0 1px 2px rgba(6, 24, 48, 0.45); }
}

/* نمادهای ریاضی شناور کنار کارت */
.auth-sym {
    position: fixed;
    z-index: 0;
    font-family: var(--font-en);
    font-weight: 900;
    color: rgba(255, 255, 255, 0.16);
    text-shadow: 0 0 18px rgba(126, 192, 238, 0.35);
    pointer-events: none;
    animation: auth-sym-float 9s ease-in-out infinite;
}
.auth-sym--1 { top: 14%; inset-inline-start: 8%;  font-size: 54px; animation-delay: 0s;   }
.auth-sym--2 { top: 68%; inset-inline-start: 13%; font-size: 42px; animation-delay: -2.4s; }
.auth-sym--3 { top: 22%; inset-inline-end: 10%;  font-size: 60px; animation-delay: -4.2s; }
.auth-sym--4 { top: 72%; inset-inline-end: 14%;  font-size: 44px; animation-delay: -6.1s; }
.auth-sym--5 { top: 44%; inset-inline-start: 4%;  font-size: 36px; animation-delay: -7.6s; }
.auth-sym--6 { top: 42%; inset-inline-end: 5%;   font-size: 40px; animation-delay: -3.3s; }
@keyframes auth-sym-float {
    0%, 100% { transform: translateY(0) rotate(-6deg); opacity: 0.55; }
    50%      { transform: translateY(-22px) rotate(8deg); opacity: 1; }
}

/* ورودی‌ها — پس‌زمینهٔ تیره‌تر برای کنتراست بالاتر متن */
.auth-card input,
.auth-card select {
    background: rgba(10, 34, 58, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.30);
    color: #ffffff;
    font-weight: 600;
}
.auth-card input:focus,
.auth-card select:focus {
    background: rgba(10, 34, 58, 0.58);
    border-color: rgba(144, 220, 190, 0.90);
}
.auth-card input::placeholder {
    color: rgba(255, 255, 255, 0.72);
    font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
    .auth-card::before, .auth-card .shine-sweep::after, .auth-card h1, .auth-sym {
        animation: none !important;
    }
    .auth-sym { opacity: 0.35; }
}

/* ═══════════════════════════════════════════════════════════════
   راند ۱۱ — تایپوگرافی خفن پنل ورود
   متن‌های سفید + گرادیان متحرک + برق عبوری + هالهٔ نئون نرم
   ═══════════════════════════════════════════════════════════════ */

/* عنوان اصلی — متنِ گرادیانی متحرک با برق عبوری */
.auth-card h1 {
    position: relative;
    background: linear-gradient(110deg,
        #ffffff 0%, #dff1ff 22%, #7ec0ee 40%,
        #ffffff 55%, #dff1ff 72%, #7ec0ee 88%, #ffffff 100%);
    background-size: 260% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    animation: auth-title-flow 7s linear infinite;
    filter: drop-shadow(0 2px 16px rgba(126, 192, 238, 0.55));
}
@keyframes auth-title-flow {
    from { background-position: 260% 0; }
    to   { background-position: -260% 0; }
}

/* زیرعنوان — سفید نرم با نویزِ نور آرام */
.auth-card .subtitle {
    position: relative;
    animation: auth-sub-breathe 5.5s ease-in-out infinite;
}
@keyframes auth-sub-breathe {
    0%, 100% { text-shadow: 0 1px 6px rgba(6, 24, 48, 0.35), 0 0 0 rgba(126, 192, 238, 0); }
    50%      { text-shadow: 0 1px 6px rgba(6, 24, 48, 0.35), 0 0 18px rgba(126, 192, 238, 0.45); }
}

/* خط تزئینی زیر عنوان — گرادیان سبز→آبی که نفس می‌کشد */
.auth-card h1::after {
    content: '';
    display: block;
    width: 64px;
    height: 3px;
    margin: 12px auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #7ce8b5, #7ec0ee);
    box-shadow: 0 0 12px rgba(124, 232, 181, 0.65);
    animation: auth-divider-breathe 3.2s ease-in-out infinite;
}
@keyframes auth-divider-breathe {
    0%, 100% { width: 64px; opacity: 0.85; }
    50%      { width: 96px; opacity: 1; }
}

/* برچسب ورودی‌ها — سفید خالص، کمی درشت‌تر و شارپ‌تر */
.auth-card label,
.auth-card .field-label {
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 4px rgba(6, 24, 48, 0.4);
}

/* متن‌های کمکی (فراموشی رمز، لینک ثبت‌نام) — سفید روشن با هاور سبز نئون */
.auth-card a,
.auth-card .auth-link {
    color: #dff3ff;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1.5px dashed rgba(124, 232, 181, 0.65);
    padding-bottom: 1px;
    transition: color 0.2s ease, text-shadow 0.2s ease, border-color 0.2s ease;
}
.auth-card a:hover,
.auth-card .auth-link:hover {
    color: #ffffff;
    text-shadow: 0 0 14px rgba(124, 232, 181, 0.85);
    border-bottom-color: #7ce8b5;
}

/* پاراگراف‌های کوچک داخل کارت — سفید ۹۲٪ (خوانایی بالا) */
.auth-card p,
.auth-card small,
.auth-card .hint,
.auth-card .auth-hint {
    color: rgba(255, 255, 255, 0.93);
    text-shadow: 0 1px 3px rgba(6, 24, 48, 0.35);
}

/* ورودی متن — متن سفید، placeholder روشن */
.auth-card input {
    color: #ffffff;
    font-weight: 600;
}
.auth-card input::placeholder {
    color: rgba(255, 255, 255, 0.62);
    font-weight: 400;
}

@media (prefers-reduced-motion: reduce) {
    .auth-card h1,
    .auth-card h1::after,
    .auth-card .subtitle {
        animation: none !important;
        -webkit-text-fill-color: #ffffff;
        background: none;
    }
}

/* ══════════ راند ۲۴ — سوییچ «دانش‌آموز سمپاد هستم» ══════════ */
.sampad-toggle {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    cursor: pointer;
    user-select: none;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.16);
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    box-sizing: border-box;
}

.sampad-toggle:hover {
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(255, 255, 255, 0.28);
}

.sampad-toggle:has(input:checked) {
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.16), rgba(245, 158, 11, 0.10));
    border-color: rgba(250, 204, 21, 0.55);
    box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.12), 0 6px 18px rgba(245, 158, 11, 0.18);
}

.sampad-toggle input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.sampad-toggle__box {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-top: 2px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.08);
    display: grid;
    place-items: center;
    color: transparent;
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sampad-toggle:has(input:checked) .sampad-toggle__box {
    background: linear-gradient(135deg, #facc15, #f59e0b);
    border-color: #fde047;
    color: #4a3200;
    transform: scale(1.06);
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.45);
}

.sampad-toggle__check {
    width: 15px;
    height: 15px;
    opacity: 0;
    transform: scale(0.4);
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sampad-toggle:has(input:checked) .sampad-toggle__check {
    opacity: 1;
    transform: scale(1);
}

.sampad-toggle__label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.sampad-toggle__title {
    font-weight: 800;
    font-size: 0.95rem;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(6, 24, 48, 0.35);
}

.sampad-toggle__hint {
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.78);
}

.sampad-toggle:has(input:checked) .sampad-toggle__title {
    color: #fde047;
}
