@font-face {
    font-family: 'Iransans';
    src: url('../font/Iransans.ttf') format('truetype'), url('../font/Iransans.woff') format('woff');
}

* {
    font-family: 'Vazirmatn', 'Iransans';
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-primary-rgb: 15, 118, 200;
    --color-primary: #4fb0ff;
    --color-primary-dark: #0a4a8a;
    --color-bg: #000000;
    --color-surface: #0a0a0a;
    --color-primary-r: 56;
    --color-primary-g: 189;
    --color-primary-b: 248;
}

html,
body {
    height: 100%;
    margin: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background: var(--color-bg);
    color: #f0f0f0;
}

.glow-sm {
    box-shadow: 0 0px 20px rgba(var(--color-primary-rgb), 0.25), 0 0px 40px rgba(0, 0, 0, 0.8);
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-surface);
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-dark);
}

.auth-section {
    position: relative;
    overflow: hidden;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes shake {

    10%,
    90% {
        transform: translateX(-1px);
    }

    20%,
    80% {
        transform: translateX(2px);
    }

    30%,
    50%,
    70% {
        transform: translateX(-4px);
    }

    40%,
    60% {
        transform: translateX(4px);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) translateX(0);
        opacity: 0.4;
    }

    50% {
        transform: translateY(-80px) translateX(20px);
        opacity: 0.1;
    }
}

.animate-fade-up {
    animation: fadeUp 0.6s ease forwards;
    opacity: 0;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 50%;
    opacity: 0.4;
    animation: float 6s infinite ease-in-out;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: scale(1.02);
}

.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.glow-card {
    box-shadow: 0 0px 40px rgba(var(--color-primary-rgb), 0.12), 0 20px 60px rgba(0, 0, 0, 0.6);
}

.card-border {
    border: 1px solid rgba(var(--color-primary-rgb), 0.16);
}

/* ========| Auth Tabs |======== */
.auth-tabs {
    background: rgba(17, 24, 39, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.1rem;
    padding: 0.35rem;
}

.auth-tab {
    flex: 1;
    padding: 0.7rem 1rem;
    border-radius: 0.8rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #9ca3af;
    background: transparent;
    cursor: pointer;
    transition: all 0.25s ease;
}

.auth-tab:hover {
    color: #fff;
}

.auth-tab.active {
    color: #fff;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    box-shadow: 0 0 16px rgba(var(--color-primary-rgb), 0.35);
}

/* ========| Auth Panels |======== */
.auth-panel {
    display: none;
    flex-direction: column;
    gap: 1.35rem;
}

.auth-panel.active {
    display: flex;
    animation: fadeUp 0.45s ease forwards;
}

/* ========| Inputs |======== */
.form-field {
    width: 100%;
    background: rgba(17, 24, 39, 0.5);
    border: 1px solid #1f2937;
    border-radius: 1rem;
    padding: 0.75rem 1.1rem;
    font-size: 0.875rem;
    color: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-field::placeholder {
    color: #6b7280;
}

.form-field:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 14px rgba(var(--color-primary-rgb), 0.2);
}

.field-wrap {
    position: relative;
}

.field-wrap .form-field {
    padding-left: 2.75rem;
}

.field-wrap.has-toggle .form-field {
    padding-left: 2.75rem;
}

.password-toggle {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: var(--color-primary);
}

.password-toggle svg {
    width: 18px;
    height: 18px;
}

.form-field.input-invalid {
    border-color: rgba(248, 113, 113, 0.6);
    box-shadow: 0 0 12px rgba(248, 113, 113, 0.15);
}

.form-field.input-valid {
    border-color: rgba(52, 211, 153, 0.5);
}

/* ========| Field Error |======== */
.field-error {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #fca5a5;
    font-size: 0.76rem;
    line-height: 1.6;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.25s ease, margin-top 0.3s ease;
}

.field-error svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: #f87171;
}

.field-error.show {
    max-height: 3rem;
    opacity: 1;
    margin-top: 0.15rem;
    animation: shake 0.4s ease;
}

/* ========| Slider Captcha |======== */
.slider-captcha-track {
    position: relative;
    height: 3rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    user-select: none;
    touch-action: none;
}

.slider-captcha-fill {
    position: absolute;
    inset: 0;
    width: 0%;
    background: linear-gradient(90deg, rgba(var(--color-primary-rgb), 0.35), rgba(var(--color-primary-rgb), 0.15));
    transition: width 0.05s linear;
    pointer-events: none;
}

.slider-captcha.solved .slider-captcha-fill {
    background: linear-gradient(90deg, rgba(52, 211, 153, 0.4), rgba(52, 211, 153, 0.18));
}

.slider-captcha-target {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8%;
    background: rgba(255, 255, 255, 0.08);
    border-inline: 1px dashed rgba(255, 255, 255, 0.25);
    pointer-events: none;
}

.slider-captcha-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.78rem;
    pointer-events: none;
    transition: opacity 0.2s;
}

.slider-captcha.solved .slider-captcha-label {
    color: #6ee7b7;
}

.slider-captcha-handle {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.85rem;
    background: rgb(var(--color-primary-r, 15), var(--color-primary-g, 118), var(--color-primary-b, 200));
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    box-shadow: 0 4px 14px rgba(var(--color-primary-rgb), 0.4);
    transition: background 0.2s, right 0.05s linear;
    border: none;
}

.slider-captcha-handle:active {
    cursor: grabbing;
}

.slider-captcha.solved .slider-captcha-handle {
    background: #10b981;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
    cursor: default;
}

.slider-captcha.error .slider-captcha-track {
    border-color: rgba(248, 113, 113, 0.5);
    animation: shake 0.4s ease;
}

/* ========| Custom Checkbox |======== */
.check-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.check-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.check-box {
    width: 20px;
    height: 20px;
    border-radius: 0.4rem;
    border: 1.5px solid #374151;
    background: rgba(17, 24, 39, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.check-box svg {
    width: 13px;
    height: 13px;
    color: #fff;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.check-row input:checked+.check-box {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border-color: transparent;
}

.check-row input:checked+.check-box svg {
    opacity: 1;
    transform: scale(1);
}

.check-row input:focus-visible+.check-box {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.check-label {
    font-size: 0.82rem;
    color: #9ca3af;
    line-height: 1.7;
    cursor: pointer;
    user-select: none;
}

.check-label button {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    padding: 0;
}

/* ========| OTP Inputs |======== */
.otp-row {
    display: flex;
    gap: 0.7rem;
    justify-content: center;
}

.otp-digit {
    width: 3rem;
    height: 3.5rem;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    background: rgba(17, 24, 39, 0.5);
    border: 1.5px solid #1f2937;
    border-radius: 1rem;
    color: #fff;
    transition: all 0.25s ease;
}

.otp-digit:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 14px rgba(var(--color-primary-rgb), 0.3);
    transform: translateY(-2px);
}

.otp-digit.filled {
    border-color: rgba(var(--color-primary-rgb), 0.5);
}

/* ========| Modal |======== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: rgb(10, 10, 12);
    border: 1px solid rgba(var(--color-primary-rgb), 0.25);
    border-radius: 1.5rem;
    max-width: 32rem;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.98);
    transition: transform 0.3s ease;
}

.modal-overlay.open .modal-box {
    transform: translateY(0) scale(1);
}

.modal-body {
    overflow-y: auto;
    padding: 0 1.75rem 1.75rem;
    color: #9ca3af;
    font-size: 0.85rem;
    line-height: 2;
}

.modal-body h4 {
    color: #e5e7eb;
    font-weight: 700;
    margin: 1.1rem 0 0.4rem;
    font-size: 0.9rem;
}

.modal-body h4:first-child {
    margin-top: 0;
}

.modal-body h3 {
    color: #fff;
    font-weight: 800;
    font-size: 0.98rem;
    margin: 1.6rem 0 0.2rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-body h3:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.modal-body ul {
    margin: 0.5rem 0 1rem;
    padding-right: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    list-style: disc;
}

.modal-body ul li {
    font-size: 0.85rem;
}

/* ========| Success Overlay |======== */
.success-overlay {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.success-overlay.active {
    display: flex;
    animation: fadeUp 0.5s ease forwards;
}

.success-icon-circle {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #34d399;
}

.success-icon-circle svg {
    width: 2.25rem;
    height: 2.25rem;
}

/* ========| Divider |======== */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #4b5563;
    font-size: 0.75rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}
