/* ============================================================
   BOXZERO - REGISTER & LOGIN PAGE STYLES
   Version: 2.5.3
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================================
   FONTS
   ============================================================ */
@font-face {
    font-family: 'Vazir';
    src: url('../font/Vazir-Regular.woff2') format('woff2'),
         url('../font/Vazir-Regular.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('../font/Vazir-Light.ttf') format('truetype');
    font-weight: 300;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('../font/Vazir-Bold.ttf') format('truetype');
    font-weight: 700;
    font-display: swap;
}

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
    /* Backgrounds */
    --bg-gradient-start: #0f172a;
    --bg-gradient-mid: #1e293b;
    --bg-gradient-end: #0f172a;
    --bg-gradient-last: #020617;
    
    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Cards */
    --card-bg: rgba(30, 41, 59, 0.92);
    --card-bg-solid: #1e293b;
    
    /* Borders */
    --border-color: rgba(71, 85, 105, 0.5);
    --border-hover: rgba(176, 8, 243, 0.6);
    
    /* Buttons */
    --btn-gradient: linear-gradient(135deg, #b008f3, #8b5cf6);
    --btn-hover: linear-gradient(135deg, #c026f3, #7c3aed);
    
    /* Shadows */
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px rgba(176, 8, 243, 0.2);
    
    /* Accent */
    --accent-color: #b008f3;
    --accent-light: #c026f3;
    --accent-dark: #8b00e0;
    
    /* Status */
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #8b5cf6;
    
    /* Inputs */
    --input-bg: rgba(255, 255, 255, 0.05);
    
    /* Scrollbar */
    --scrollbar-track: #1e293b;
    --scrollbar-thumb: #b008f3;
    
    /* Radius */
    --radius: 16px;
    --radius-lg: 32px;
    
    /* Transition */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ============================================================
   LIGHT THEME
   ============================================================ */
[data-theme="light"] {
    --bg-gradient-start: #f8fafc;
    --bg-gradient-mid: #f1f5f9;
    --bg-gradient-end: #e2e8f0;
    --bg-gradient-last: #cbd5e1;
    
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    --card-bg: rgba(255, 255, 255, 0.92);
    --card-bg-solid: #ffffff;
    
    --border-color: rgba(148, 163, 184, 0.3);
    --border-hover: rgba(176, 8, 243, 0.5);
    
    --shadow-color: rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 30px rgba(176, 8, 243, 0.08);
    
    --input-bg: rgba(0, 0, 0, 0.03);
    
    --scrollbar-track: #e2e8f0;
    --scrollbar-thumb: #b008f3;
}

/* ============================================================
   BASE
   ============================================================ */
body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at 50% 0%, 
        var(--bg-gradient-start), 
        var(--bg-gradient-mid), 
        var(--bg-gradient-end), 
        var(--bg-gradient-last)
    );
    color: var(--text-primary);
    font-family: 'Vazir', 'Tahoma', sans-serif;
    transition: var(--transition);
    padding: 20px;
    position: relative;
    margin: 0;
}

/* ============================================================
   BACKGROUND EFFECTS
   ============================================================ */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(176, 8, 243, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(176, 8, 243, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

/* Floating orbs */
body::after {
    content: '';
    position: fixed;
    top: -30%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(176, 8, 243, 0.06), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

/* 1. THE BACKGROUND GRID */
.grid-bg {
    position: fixed; /* Fixed so it stays put while scrolling */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0; /* Behind all content */
    pointer-events: none; /* Allows clicking through it */
        
    /* Create the grid */
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 60px 60px; /* Size of each grid square */
    background-position: -1px -1px; /* Fix slight alignment issues */
}


/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-light);
}

/* ============================================================
   THEME TOGGLE BUTTON
   ============================================================ */
.theme-toggle {
    position: fixed;
    bottom: 25px;
    left: 25px;
    width: 48px;
    height: 48px;
    
    /* Glass Background & Heavy Blur */
    background: rgba(255, 255, 255, 0.06); /* Translucent glass base */
    backdrop-filter: blur(16px);            /* Deep blur behind the circle */
    -webkit-backdrop-filter: blur(16px);
    
    /* Sharp Stroke & Perfect Roundness */
    border: 1px solid rgba(255, 255, 255, 0.15); /* Crisp translucent outline */
    border-radius: 999px; /* Perfectly round circle */
    
    /* Layout & Depth */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Hover Effect */
.theme-toggle:hover {
    transform: translateY(-4px) scale(1.05);
    border-color: var(--purple); /* Stroke lights up purple */
    box-shadow: 0 12px 40px rgba(176, 8, 243, 0.25); /* Purple glow */
}

/* Click Effect */
.theme-toggle:active {
    transform: scale(0.92);
}

/* Icon Styling */
.theme-toggle i {
    font-size: 20px;
    color: var(--text-dark);
    transition: var(--transition);
}

/* ----- Light Mode Adjustments ----- */
[data-theme="light"] .theme-toggle {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .theme-toggle:hover {
    border-color: var(--purple);
    box-shadow: 0 10px 30px rgba(176, 8, 243, 0.15);
}

/* ============================================================
   MAIN CARD
   ============================================================ */
.cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 45px 40px 40px;
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    transition: var(--transition-bounce);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 60px -12px var(--shadow-color);
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.cart:hover {
    border-color: var(--border-hover);
    box-shadow: 0 30px 70px -15px var(--shadow-color);
    transform: translateY(-4px);
}

/* Glass reflection effect */
.cart::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    pointer-events: none;
}

/* ============================================================
   CARD HEADER
   ============================================================ */
.cart-icon {
    width: 72px;
    height: 72px;
    background: var(--btn-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    box-shadow: var(--shadow-glow);
    flex-shrink: 0;
}

.cart-icon i {
    font-size: 2rem;
    color: #ffffff;
}

.cart .logo {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 6px;
    background: var(--btn-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-align: center;
    cursor: default;
}

.cart .subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 28px;
    text-align: center;
    line-height: 1.6;
}

/* ============================================================
   FORM GROUPS
   ============================================================ */
.input-group {
    position: relative;
    width: 100%;
    margin-bottom: 18px;
}

.input-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    transition: var(--transition);
    pointer-events: none;
}

/* ============================================================
   INPUTS (RTL)
   ============================================================ */
input {
    width: 100%;
    padding: 13px 46px 13px 16px;
    background: var(--input-bg);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
    font-size: 0.95rem;
    font-family: 'Vazir', 'Tahoma', sans-serif;
    direction: rtl;
    text-align: right;
}

input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
    text-align: right;
}

input:focus {
    border-color: var(--accent-color);
    background: var(--card-bg-solid);
    box-shadow: 0 0 0 4px rgba(176, 8, 243, 0.08);
}

input:focus + .input-icon {
    color: var(--accent-color);
}

/* Input with left icon */
.input-with-icon {
    padding-left: 46px;
}

/* ============================================================
   PASSWORD TOGGLE
   ============================================================ */
.toggle-password {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    background: transparent;
    border: none;
    font-size: 1rem;
    padding: 4px;
}

.toggle-password:hover {
    color: var(--accent-light);
}

.toggle-password:active {
    transform: translateY(-50%) scale(0.9);
}

/* ============================================================
   PASSWORD STRENGTH
   ============================================================ */
.password-strength {
    width: 100%;
    margin-top: -6px;
    margin-bottom: 18px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.strength-bar {
    height: 4px;
    border-radius: 4px;
    margin-top: 6px;
    transition: var(--transition);
    background: var(--border-color);
}

.strength-weak {
    width: 33%;
    background: var(--danger-color);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

.strength-medium {
    width: 66%;
    background: var(--warning-color);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

.strength-strong {
    width: 100%;
    background: var(--success-color);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.3);
}

/* ============================================================
   FORM OPTIONS
   ============================================================ */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--accent-color);
    padding: 0;
    flex-shrink: 0;
}

.forgot-link {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.forgot-link:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

/* ============================================================
   TERMS CHECKBOX
   ============================================================ */
.terms-checkbox {
    width: 100%;
    margin: 6px 0 16px;
}

.terms-checkbox .checkbox-label {
    justify-content: center;
    font-size: 0.82rem;
}

.terms-checkbox a {
    color: var(--accent-light);
    text-decoration: none;
    font-weight: 500;
}

.terms-checkbox a:hover {
    text-decoration: underline;
    color: var(--accent-color);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    width: 100%;
    padding: 14px 20px;
    background: var(--btn-gradient);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition-bounce);
    font-weight: 600;
    font-size: 1rem;
    color: #ffffff;
    font-family: 'Vazir', 'Tahoma', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    margin-top: 4px;
}

/* Shine effect */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    transition: left 0.6s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background: var(--btn-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.btn:active {
    transform: translateY(0) scale(0.97);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn i {
    font-size: 1rem;
}

/* ============================================================
   DIVIDER
   ============================================================ */
.divider {
    width: 100%;
    text-align: center;
    margin: 22px 0 20px;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 35px);
    height: 1px;
    background: var(--border-color);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.divider span {
    background: var(--card-bg);
    padding: 0 16px;
    color: var(--text-muted);
    font-size: 0.8rem;
    position: relative;
    z-index: 1;
}

/* ============================================================
   SOCIAL BUTTONS
   ============================================================ */
.social-login {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-bottom: 18px;
}

.social-btn {
    flex: 1;
    padding: 11px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 50px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-bounce);
    font-family: 'Vazir', 'Tahoma', sans-serif;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.social-btn:hover {
    transform: translateY(-3px);
    border-color: var(--accent-color);
}

.social-btn.google:hover {
    background: #db4437;
    border-color: #db4437;
    color: #ffffff;
    box-shadow: 0 8px 25px rgba(219, 68, 55, 0.25);
}

.social-btn.github:hover {
    background: #24292e;
    border-color: #24292e;
    color: #ffffff;
    box-shadow: 0 8px 25px rgba(36, 41, 46, 0.25);
}

.social-btn i {
    font-size: 1.1rem;
}

/* ============================================================
   AUTH LINK
   ============================================================ */
.auth-link {
    margin-top: 18px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.auth-link a {
    color: var(--accent-light);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.auth-link a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* ============================================================
   MESSAGES
   ============================================================ */
.error-message,
.success-message {
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 0.85rem;
    text-align: center;
    width: 100%;
    display: none;
    animation: shakeIn 0.4s ease;
}

.error-message {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger-color);
}

.success-message {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success-color);
}

.error-message.show,
.success-message.show {
    display: block;
}

@keyframes shakeIn {
    0%, 100% { transform: translateX(0); opacity: 0; }
    20% { transform: translateX(-8px); opacity: 1; }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn.loading .loading-spinner {
    display: inline-block;
}

.btn.loading .btn-text {
    display: none;
}

/* ============================================================
   RESPONSIVE - TABLET
   ============================================================ */
@media (max-width: 768px) {
    .cart {
        padding: 35px 28px 32px;
        max-width: 95%;
        border-radius: 24px;
    }
    
    .cart .logo {
        font-size: 1.7rem;
    }
    
    .cart-icon {
        width: 60px;
        height: 60px;
    }
    
    .cart-icon i {
        font-size: 1.6rem;
    }
    
    .social-login {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .theme-toggle {
        bottom: 24px;
        left: 24px;
        width: 48px;
        height: 48px;
    }
    
    .theme-toggle i {
        font-size: 20px;
    }
}

/* ============================================================
   RESPONSIVE - MOBILE
   ============================================================ */
@media (max-width: 480px) {
    body {
        padding: 12px;
    }
    
    .cart {
        padding: 24px 18px 22px;
        border-radius: 20px;
    }
    
    .cart-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 14px;
    }
    
    .cart-icon i {
        font-size: 1.3rem;
    }
    
    .cart .logo {
        font-size: 1.4rem;
        margin-bottom: 4px;
    }
    
    .cart .subtitle {
        font-size: 0.75rem;
        margin-bottom: 20px;
    }
    
    input {
        padding: 11px 40px 11px 14px;
        font-size: 0.85rem;
        border-radius: 12px;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 0.88rem;
        border-radius: 40px;
    }
    
    .social-btn {
        padding: 10px 12px;
        font-size: 0.8rem;
    }
    
    .checkbox-label {
        font-size: 0.78rem;
    }
    
    .auth-link {
        font-size: 0.78rem;
        margin-top: 14px;
    }
    
    .divider {
        margin: 18px 0 16px;
    }
    
    .divider span {
        font-size: 0.75rem;
        padding: 0 12px;
    }
    
    .theme-toggle {
        bottom: 16px;
        left: 16px;
        width: 42px;
        height: 42px;
    }
    
    .theme-toggle i {
        font-size: 17px;
    }
    
    .error-message,
    .success-message {
        font-size: 0.78rem;
        padding: 10px 12px;
        border-radius: 12px;
    }
    
    .terms-checkbox .checkbox-label {
        font-size: 0.75rem;
    }
    
    .password-strength {
        font-size: 0.65rem;
    }
}

/* ============================================================
   RESPONSIVE - VERY SMALL
   ============================================================ */
@media (max-width: 380px) {
    .cart {
        padding: 18px 14px 16px;
    }
    
    input {
        padding: 9px 34px 9px 12px;
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 10px 14px;
        font-size: 0.82rem;
    }
    
    .cart .logo {
        font-size: 1.2rem;
    }
}

/* ============================================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .cart {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* ============================================================
   FOCUS VISIBLE (Keyboard Navigation)
   ============================================================ */
:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* ============================================================
   SELECTION
   ============================================================ */
::selection {
    background: var(--accent-color);
    color: #ffffff;
}