/**
 * AqarScope - Authentication Pages Styles
 * Brand Color: #059191
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    --brand: #059191;
    --brand-dark: #047878;
    --brand-light: #06a5a5;
    --brand-rgb: 5, 145, 145;
    --secondary: #7C7C7C;
    --light: #D1D3D4;
    --dark: #1a1a2e;
    --text-primary: #1a1a2e;
    --text-secondary: #7C7C7C;
    --text-light: #9ca3af;
    --bg-white: #ffffff;
    --bg-light: #f8fafb;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --font-primary: 'El Messiri', 'Zain', sans-serif;
    --font-secondary: 'Alexandria', 'Zain', sans-serif;
    --font-display: 'Zain', 'El Messiri', sans-serif;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.1);
    --shadow-brand: 0 4px 20px rgba(5, 145, 145, 0.3);
    --shadow-brand-lg: 0 8px 30px rgba(5, 145, 145, 0.4);
    --radius: 12px;
    --transition: 0.3s ease;
}

/* ========================================
   Reset & Base
   ======================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-secondary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--bg-white);
}

a { text-decoration: none; }

/* ========================================
   Animations
   ======================================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes floatSlow {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(3deg); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(5, 145, 145, 0.15); }
    50% { box-shadow: 0 0 40px rgba(5, 145, 145, 0.3); }
}

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

@keyframes shakeX {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* ========================================
   Auth Container - Split Layout
   ======================================== */
.auth-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ========================================
   Visual Side
   ======================================== */
.auth-visual-side {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 50%, #036666 100%);
    background-size: 300% 300%;
    animation: gradientShift 12s ease infinite;
}

.auth-visual-register {
    background: linear-gradient(135deg, #036666 0%, var(--brand-dark) 50%, var(--brand) 100%);
    background-size: 300% 300%;
}

.auth-visual-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.visual-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.08;
    background: white;
}

.visual-shape-1 {
    width: 350px;
    height: 350px;
    top: -10%;
    right: -8%;
    animation: float 8s ease-in-out infinite;
}

.visual-shape-2 {
    width: 200px;
    height: 200px;
    bottom: 15%;
    left: -5%;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: floatSlow 10s ease-in-out infinite;
}

.visual-shape-3 {
    width: 120px;
    height: 120px;
    top: 50%;
    right: 15%;
    animation: float 7s ease-in-out infinite 1s;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
}

.visual-shape-4 {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 20%;
    border-radius: 30%;
    animation: floatSlow 12s ease-in-out infinite;
    background: rgba(255,255,255,0.04);
}

.visual-grid-pattern {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.04) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

.auth-visual-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    padding: 48px;
    max-width: 480px;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.visual-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 40px;
}

.visual-logo-icon {
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    animation: pulseGlow 3s ease-in-out infinite;
}

.visual-logo-text {
    display: flex;
    flex-direction: column;
    text-align: right;
    line-height: 1.2;
}

.visual-logo-text .logo-ar {
    font-family: var(--font-primary);
    font-size: 22px;
    font-weight: 700;
    color: white;
}

.visual-logo-text .logo-en {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 3px;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
}

.visual-title {
    font-family: var(--font-primary);
    font-size: 34px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.4;
}

.visual-title span {
    opacity: 0.85;
}

.visual-desc {
    font-size: 16px;
    color: rgba(255,255,255,0.8);
    line-height: 1.8;
    margin-bottom: 36px;
}

.visual-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.visual-feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    backdrop-filter: blur(8px);
    transition: all var(--transition);
    animation: slideInRight 0.5s ease both;
}

.visual-feature-item:nth-child(1) { animation-delay: 0.3s; }
.visual-feature-item:nth-child(2) { animation-delay: 0.4s; }
.visual-feature-item:nth-child(3) { animation-delay: 0.5s; }
.visual-feature-item:nth-child(4) { animation-delay: 0.6s; }

.visual-feature-item:hover {
    background: rgba(255,255,255,0.15);
    transform: translateX(-4px);
}

.visual-feature-item i {
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}

.visual-feature-item span {
    font-size: 14px;
    color: rgba(255,255,255,0.9);
}

/* ========================================
   Form Side
   ======================================== */
.auth-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--bg-white);
    overflow-y: auto;
}

.auth-form-wrapper {
    width: 100%;
    max-width: 460px;
    animation: fadeIn 0.5s ease;
}

/* Mobile Logo */
.auth-mobile-logo {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
    color: var(--dark);
    font-family: var(--font-primary);
    font-size: 20px;
    font-weight: 700;
}

.mobile-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

/* Header */
.auth-header {
    margin-bottom: 28px;
}

.auth-title {
    font-family: var(--font-primary);
    font-size: 30px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
}

.auth-subtitle a {
    color: var(--brand);
    font-weight: 600;
    transition: color var(--transition);
}

.auth-subtitle a:hover {
    color: var(--brand-dark);
}

/* ========================================
   Auth Message
   ======================================== */
.auth-message {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 20px;
    animation: fadeInUp 0.3s ease;
    position: relative;
}

.auth-message.show {
    display: flex;
}

.auth-message.error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.auth-message.success {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.auth-message.info {
    background: rgba(5, 145, 145, 0.08);
    border: 1px solid rgba(5, 145, 145, 0.2);
    color: var(--brand);
}

.auth-message-close {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity var(--transition);
    font-size: 14px;
}

.auth-message-close:hover {
    opacity: 1;
}

/* ========================================
   Register Progress Steps
   ======================================== */
.register-progress {
    margin-bottom: 28px;
}

.progress-bar-track {
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand), var(--brand-light));
    border-radius: 2px;
    transition: width 0.4s ease;
    width: 33.33%;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-light);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-light);
    transition: all var(--transition);
}

.progress-step.active .step-circle {
    background: var(--brand);
    border-color: var(--brand);
    color: white;
    box-shadow: var(--shadow-brand);
}

.progress-step.completed .step-circle {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.step-label {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 500;
    text-align: center;
}

.progress-step.active .step-label {
    color: var(--brand);
    font-weight: 600;
}

/* ========================================
   Form Styles
   ======================================== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-step {
    display: none;
    flex-direction: column;
    gap: 20px;
    animation: fadeInUp 0.4s ease;
}

.form-step.active {
    display: flex;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-input-group,
.form-select-group {
    position: relative;
}

.form-input,
.form-select {
    width: 100%;
    padding: 14px 16px;
    padding-right: 46px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: var(--font-secondary);
    color: var(--text-primary);
    background: var(--bg-white);
    transition: all var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(5, 145, 145, 0.08);
}

.form-input.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.08);
    animation: shakeX 0.4s ease;
}

.form-input.success {
    border-color: var(--success);
}

.form-input::placeholder {
    color: var(--text-light);
}

.input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 16px;
    transition: color var(--transition);
    pointer-events: none;
}

.form-input:focus ~ .input-icon,
.form-input-group:focus-within .input-icon {
    color: var(--brand);
}

.form-input.error ~ .input-icon {
    color: var(--danger);
}

.input-validation-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    display: none;
}

.form-input.success ~ .input-validation-icon {
    display: block;
    color: var(--success);
}

.form-input.success ~ .input-validation-icon::before {
    content: '\f058';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.form-error {
    font-size: 12px;
    color: var(--danger);
    display: none;
    padding-top: 2px;
}

.form-error.show {
    display: block;
}

/* Select */
.form-select {
    appearance: none;
    cursor: pointer;
    padding-left: 44px;
}

.select-arrow {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 12px;
    pointer-events: none;
}

/* Password Toggle */
.password-toggle-btn {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: color var(--transition);
}

.password-toggle-btn:hover {
    color: var(--brand);
}

/* Password Strength */
.password-strength {
    margin-top: 8px;
}

.strength-bars {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    transition: all var(--transition);
}

.strength-bar.weak { background: var(--danger); }
.strength-bar.medium { background: var(--warning); }
.strength-bar.strong { background: var(--success); }

.strength-text {
    font-size: 12px;
    color: var(--text-light);
    transition: color var(--transition);
}

.strength-text.weak { color: var(--danger); }
.strength-text.medium { color: var(--warning); }
.strength-text.strong { color: var(--success); }

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
}

.checkbox-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
    position: relative;
}

.checkbox-custom::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 10px;
    color: white;
    opacity: 0;
    transform: scale(0);
    transition: all var(--transition);
}

.checkbox-input:checked + .checkbox-custom {
    background: var(--brand);
    border-color: var(--brand);
}

.checkbox-input:checked + .checkbox-custom::after {
    opacity: 1;
    transform: scale(1);
}

.checkbox-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-text a {
    color: var(--brand);
    font-weight: 600;
}

.forgot-link {
    font-size: 14px;
    color: var(--brand);
    font-weight: 600;
    transition: color var(--transition);
}

.forgot-link:hover {
    color: var(--brand-dark);
}

/* Terms */
.terms-agreement {
    margin-top: 4px;
}

/* ========================================
   Buttons
   ======================================== */
.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 28px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 16px;
    font-family: var(--font-secondary);
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: white;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-brand);
    position: relative;
    overflow: hidden;
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-submit:hover::before {
    left: 100%;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-brand-lg);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-submit.loading .btn-text {
    visibility: hidden;
}

.btn-loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.btn-submit.loading .btn-loader {
    display: block;
}

.btn-submit.loading {
    pointer-events: none;
}

/* Back Button */
.btn-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-light);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-secondary);
}

.btn-back:hover {
    background: var(--border);
    color: var(--dark);
}

.btn-next {
    flex: 1;
}

.form-step-buttons {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

/* ========================================
   Divider
   ======================================== */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    padding: 0 16px;
    font-size: 13px;
    color: var(--text-light);
    white-space: nowrap;
}

/* ========================================
   Social Buttons
   ======================================== */
.social-buttons {
    display: flex;
    gap: 14px;
}

.social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-secondary);
}

.social-btn:hover {
    border-color: var(--brand);
    background: rgba(5,145,145,0.04);
    transform: translateY(-2px);
}

.social-btn-apple i {
    font-size: 22px;
}

/* ========================================
   Footer
   ======================================== */
.auth-footer {
    margin-top: 28px;
    text-align: center;
}

.auth-footer p {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.8;
}

.auth-footer a {
    color: var(--brand);
    font-weight: 500;
    transition: color var(--transition);
}

.auth-footer a:hover {
    color: var(--brand-dark);
}

/* ========================================
   Toast Notifications
   ======================================== */
.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius);
    background: white;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    min-width: 300px;
    max-width: 400px;
    animation: toastIn 0.3s ease;
    border-right: 4px solid;
}

.toast.removing {
    animation: toastOut 0.3s ease forwards;
}

.toast.toast-success {
    border-right-color: var(--success);
}

.toast.toast-error {
    border-right-color: var(--danger);
}

.toast.toast-info {
    border-right-color: var(--brand);
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-info .toast-icon { color: var(--brand); }

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    transition: color var(--transition);
}

.toast-close:hover {
    color: var(--dark);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
    .auth-visual-side {
        display: none;
    }

    .auth-form-side {
        padding: 32px 24px;
    }

    .auth-mobile-logo {
        display: flex;
    }
}

@media (max-width: 480px) {
    .auth-title {
        font-size: 26px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .social-buttons {
        flex-direction: column;
    }

    .form-options {
        flex-direction: column;
        gap: 14px;
        align-items: flex-start;
    }

    .progress-steps {
        gap: 4px;
    }

    .step-label {
        font-size: 10px;
    }

    .step-circle {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .auth-form-side {
        padding: 24px 16px;
    }
}

/* ========================================
   Print
   ======================================== */
@media print {
    .auth-visual-side {
        display: none;
    }
    .auth-form-side {
        padding: 20px;
    }
}
