/* ============================================================
   AUTH PAGE - Modern Login / Register
   ============================================================ */

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir-Regular.woff2') format('woff2'),
         url('../fonts/Vazir-Regular.woff') format('woff'),
         url('../fonts/Vazir-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir-Bold.woff2') format('woff2'),
         url('../fonts/Vazir-Bold.woff') format('woff'),
         url('../fonts/Vazir-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir-Medium.woff2') format('woff2'),
         url('../fonts/Vazir-Medium.woff') format('woff'),
         url('../fonts/Vazir-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazir', 'Vazirmatn', sans-serif;
    direction: rtl;
    background: #f8fafb;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, p, a, li, input, textarea, button, label, span, strong {
    font-family: 'Vazir', 'Vazirmatn', sans-serif !important;
}

a {
    text-decoration: none;
}

/* --- Auth Wrapper (Split Layout) --- */
.auth-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ============================================================
   LEFT VISUAL PANEL
   ============================================================ */
.auth-visual {
    position: relative;
    width: 45%;
    min-height: 100vh;
    background: linear-gradient(160deg, #059669 0%, #047857 40%, #065f46 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.visual-overlay {
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><circle cx="40" cy="40" r="1" fill="rgba(255,255,255,0.05)"/></svg>');
    background-size: 40px 40px;
    z-index: 1;
}

.visual-pattern {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.06) 0%, transparent 50%);
    z-index: 1;
}

/* Floating Shapes */
.floating-shape {
    position: absolute;
    border-radius: 50%;
    z-index: 1;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.03);
    top: -80px;
    right: -60px;
    animation: floatShape 20s ease-in-out infinite;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.04);
    bottom: 10%;
    left: -40px;
    animation: floatShape 15s ease-in-out infinite reverse;
}

.shape-3 {
    width: 120px;
    height: 120px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    top: 30%;
    left: 10%;
    animation: floatShape 18s ease-in-out infinite 2s;
}

.shape-4 {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.05);
    bottom: 25%;
    right: 15%;
    animation: floatShape 12s ease-in-out infinite 5s;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}

@keyframes floatShape {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(15px, -20px) rotate(5deg); }
    50% { transform: translate(-10px, 15px) rotate(-3deg); }
    75% { transform: translate(20px, 10px) rotate(7deg); }
}

/* Visual Content */
.visual-content {
    position: relative;
    z-index: 2;
    padding: 60px 50px;
    width: 100%;
    max-width: 520px;
}

.visual-logo {
    margin-bottom: 50px;
}

.visual-logo img {
    height: 44px;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

.visual-text h2 {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.7;
    margin-bottom: 16px;
}

.visual-text h2 span {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 400;
}

.visual-text p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.9;
    max-width: 380px;
}

/* Visual Features */
.visual-features {
    margin-top: 48px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.v-feature {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.v-feature:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(-4px);
}

.v-feature-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    flex-shrink: 0;
}

.v-feature-icon i {
    font-size: 18px;
    color: #ffffff;
}

.v-feature-text strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 2px;
}

.v-feature-text span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
}

/* Visual Stats */
.visual-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.v-stat strong {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    font-family: 'Vazir', sans-serif !important;
}

.v-stat span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.v-stat-divider {
    width: 1px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
}


/* ============================================================
   RIGHT FORM PANEL
   ============================================================ */
.auth-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 60px;
    position: relative;
    background: #ffffff;
    min-height: 100vh;
}

/* Back to Home */
.back-home {
    position: absolute;
    top: 32px;
    right: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    background: #f3f4f6;
    border-radius: 10px;
    transition: all 0.25s ease;
    text-decoration: none;
}

.back-home:hover {
    color: #059669;
    background: rgba(5, 150, 105, 0.08);
}

.back-home i {
    font-size: 12px;
    transition: transform 0.25s ease;
}

.back-home:hover i {
    transform: translateX(3px);
}

/* Form Container */
.auth-form-container {
    width: 100%;
    max-width: 420px;
}

/* --- Tab Switcher --- */
.auth-tabs {
    display: flex;
    position: relative;
    background: #f3f4f6;
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 36px;
}

.auth-tab {
    flex: 1;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    background: none;
    border: none;
    border-radius: 11px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
    text-align: center;
}

.auth-tab.active {
    color: #059669;
}

.tab-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: #ffffff;
    border-radius: 11px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

/* --- Form Header --- */
.form-header {
    margin-bottom: 28px;
}

.form-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.form-header p {
    font-size: 14px;
    color: #9ca3af;
    line-height: 1.6;
}

/* --- Input Fields --- */
.input-group {
    margin-bottom: 18px;
}

.input-row {
    display: flex;
    gap: 14px;
}

.input-row .input-group {
    flex: 1;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.input-wrapper input {
    width: 100%;
    padding: 16px 16px 16px 44px;
    font-size: 14px;
    color: #1f2937;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    direction: rtl;
}

.input-wrapper input:focus {
    background: #ffffff;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.input-wrapper label {
    position: absolute;
    top: 50%;
    right: 44px;
    transform: translateY(-50%);
    font-size: 14px;
    color: #9ca3af;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    padding: 0 4px;
}

.input-wrapper input:focus ~ label,
.input-wrapper input:not(:placeholder-shown) ~ label {
    top: 0;
    right: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #059669;
    background: linear-gradient(180deg, #ffffff 50%, #f9fafb 50%);
}

.input-wrapper input:focus ~ label {
    background: linear-gradient(180deg, #ffffff 50%, #ffffff 50%);
}

.input-icon {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    font-size: 15px;
    color: #d1d5db;
    transition: color 0.3s ease;
    z-index: 1;
}

.input-wrapper input:focus ~ .input-icon,
.input-wrapper input:focus + .input-icon {
    color: #059669;
}

/* Fix icon order — icon is before input in DOM */
.input-wrapper .input-icon {
    order: -1;
}

/* Toggle Password */
.toggle-password {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #d1d5db;
    cursor: pointer;
    padding: 4px;
    font-size: 15px;
    transition: color 0.25s ease;
    z-index: 2;
}

.toggle-password:hover {
    color: #6b7280;
}

/* --- Form Options --- */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
    user-select: none;
}

.custom-checkbox input {
    display: none;
}

.custom-checkbox .checkmark {
    width: 18px;
    height: 18px;
    border: 1.5px solid #d1d5db;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    flex-shrink: 0;
    position: relative;
}

.custom-checkbox .checkmark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s ease;
    position: absolute;
    top: 1px;
}

.custom-checkbox input:checked + .checkmark {
    background: #059669;
    border-color: #059669;
}

.custom-checkbox input:checked + .checkmark::after {
    transform: rotate(45deg) scale(1);
}

.custom-checkbox a {
    color: #059669;
    font-weight: 500;
}

.custom-checkbox a:hover {
    text-decoration: underline;
}

.forgot-link {
    font-size: 13px;
    color: #059669;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: #047857;
    text-decoration: underline;
}

/* --- Submit Button --- */
.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 24px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.btn-submit:hover::before {
    opacity: 1;
}

.btn-submit span,
.btn-submit i {
    position: relative;
    z-index: 1;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(5, 150, 105, 0.3);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.btn-submit:hover i {
    transform: translateX(-4px);
}

/* Loading State */
.btn-submit.loading {
    pointer-events: none;
    opacity: 0.85;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    position: relative;
    z-index: 1;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Divider --- */
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.divider span {
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
}

/* --- Social Login --- */
.social-login {
    display: flex;
    gap: 12px;
}

.social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    background: #ffffff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.social-btn:hover {
    border-color: #d1d5db;
    background: #f9fafb;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.social-btn.apple i {
    font-size: 20px;
}

/* --- Switch Text --- */
.switch-text {
    text-align: center;
    margin-top: 28px;
    font-size: 13px;
    color: #9ca3af;
}

.switch-btn {
    background: none;
    border: none;
    color: #059669;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s ease;
}

.switch-btn:hover {
    color: #047857;
    text-decoration: underline;
}

/* --- Password Strength --- */
.password-strength {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    margin-top: -8px;
}

.strength-bars {
    display: flex;
    gap: 4px;
    flex: 1;
}

.strength-bar {
    height: 4px;
    flex: 1;
    background: #e5e7eb;
    border-radius: 4px;
    transition: all 0.35s ease;
    transform-origin: right;
}

.strength-text {
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
    min-width: 80px;
    text-align: left;
    transition: color 0.3s ease;
}

/* --- Animations --- */
.auth-form {
    animation: fadeSlideUp 0.4s ease-out;
}

.auth-form.hidden {
    display: none;
}

.auth-form.fade-in {
    animation: fadeSlideUp 0.35s ease-out;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet */
@media (max-width: 1100px) {
    .auth-visual {
        width: 40%;
    }

    .visual-content {
        padding: 40px 36px;
    }

    .visual-text h2 {
        font-size: 24px;
    }
}

@media (max-width: 900px) {
    .auth-wrapper {
        flex-direction: column;
    }

    .auth-visual {
        width: 100%;
        min-height: auto;
        padding: 48px 24px;
    }

    .visual-content {
        max-width: 600px;
        margin: 0 auto;
        padding: 0;
        text-align: center;
    }

    .visual-logo {
        margin-bottom: 28px;
    }

    .visual-text h2 {
        font-size: 22px;
    }

    .visual-text p {
        max-width: 100%;
        margin: 0 auto;
    }

    .visual-features {
        display: none;
    }

    .visual-stats {
        justify-content: center;
        margin-top: 28px;
        padding-top: 24px;
    }

    .auth-form-panel {
        min-height: auto;
        padding: 40px 24px 60px;
    }

    .back-home {
        position: static;
        align-self: flex-start;
        margin-bottom: 24px;
    }

    .floating-shape {
        display: none;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .auth-visual {
        padding: 36px 20px;
    }

    .visual-text h2 {
        font-size: 20px;
    }

    .visual-stats {
        gap: 16px;
    }

    .v-stat strong {
        font-size: 18px;
    }

    .auth-form-panel {
        padding: 32px 20px 48px;
    }

    .auth-form-container {
        max-width: 100%;
    }

    .input-row {
        flex-direction: column;
        gap: 0;
    }

    .form-header h3 {
        font-size: 20px;
    }

    .social-login {
        flex-direction: column;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* Ultra-wide screens */
@media (min-width: 1600px) {
    .auth-visual {
        width: 50%;
    }

    .visual-content {
        max-width: 560px;
    }

    .visual-text h2 {
        font-size: 32px;
    }
}
