/* ========================================
   RESET & BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --primary-dark: #2c1810;
    --primary-brown: #4a2f1f;
    --accent-gold: #d4a574;
    --accent-gold-light: #e8c9a0;
    --accent-gold-dark: #b88a5e;

    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Status Colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --error: #ef4444;
    --error-light: #fee2e2;
    --warning: #f59e0b;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: var(--gray-900);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Arabic Font Support */
/* Removed global RTL override to allow Inter/Tajawal fallback to work naturally for mixed content */

/* ========================================
   LANGUAGE TOGGLE
   ======================================== */
.language-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.lang-btn {
    padding: 8px 20px;
    background: transparent;
    border: none;
    color: var(--gray-300);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 50px;
    transition: all var(--transition-base);
    position: relative;
}

.lang-btn:hover {
    color: var(--white);
}

.lang-btn.active {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
    color: var(--primary-dark);
    box-shadow: 0 2px 10px rgba(212, 165, 116, 0.4);
}

.lang-btn span {
    position: relative;
    z-index: 1;
}

/* ========================================
   BACKGROUND ELEMENTS
   ======================================== */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(212, 165, 116, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(44, 24, 16, 0.2) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255, 255, 255, 0.02) 35px, rgba(255, 255, 255, 0.02) 70px);
    pointer-events: none;
    z-index: 0;
}

/* ========================================
   CONTAINER
   ======================================== */
.container {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-lg);
}

/* ========================================
   HEADER
   ======================================== */
.header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    animation: fadeInDown 0.8s ease-out;
}

.logo-container {
    margin-bottom: var(--spacing-lg);
}

.logo {
    max-width: 320px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.header-content {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-2xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-2xl);
}

.edition-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
    color: var(--primary-dark);
    padding: var(--spacing-xs) var(--spacing-lg);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: var(--spacing-md);
    box-shadow: 0 4px 15px rgba(212, 165, 116, 0.4);
}

.title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-gold);
    margin-bottom: var(--spacing-sm);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
    font-family: 'Inter', sans-serif;
}

.title-arabic {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-gold-light);
    margin-bottom: var(--spacing-lg);
    font-family: 'Tajawal', sans-serif;
}

.event-details {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}

.detail-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    color: var(--gray-200);
    font-size: 0.95rem;
}

.icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    color: var(--accent-gold);
}

/* ========================================
   FORM CONTAINER
   ======================================== */
.form-container {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-2xl);
    padding: var(--spacing-2xl);
    box-shadow: var(--shadow-2xl);
    border: 1px solid rgba(212, 165, 116, 0.2);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.form-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--gray-200);
}

.form-header h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: var(--spacing-sm);
}

.form-header p {
    color: var(--gray-600);
    font-size: 0.95rem;
}

/* ========================================
   FORM STYLES
   ======================================== */
.registration-form {
    display: grid;
    gap: var(--spacing-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.form-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.95rem;
}

.required {
    color: var(--error);
    font-weight: 700;
}

.form-input {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-base);
    background: var(--white);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 4px rgba(212, 165, 116, 0.1);
    transform: translateY(-2px);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-input.error {
    border-color: var(--error);
    background: var(--error-light);
}

.error-message {
    color: var(--error);
    font-size: 0.875rem;
    font-weight: 500;
    display: none;
    animation: shake 0.3s ease-in-out;
}

.error-message.show {
    display: block;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* ========================================
   SUBMIT BUTTON
   ======================================== */
.submit-btn {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg) var(--spacing-2xl);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-brown) 100%);
    color: var(--accent-gold);
    border: none;
    border-radius: var(--radius-xl);
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 10px 30px rgba(44, 24, 16, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    position: relative;
    overflow: hidden;
}

.submit-btn::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;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(44, 24, 16, 0.4);
}

.submit-btn:active {
    transform: translateY(-1px);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-text {
    transition: opacity var(--transition-fast);
}

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(212, 165, 116, 0.3);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.submit-btn.loading .btn-text,
.submit-btn.loading .btn-icon {
    display: none;
}

.submit-btn.loading .btn-loader {
    display: block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-icon {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

/* ========================================
   SUCCESS MESSAGE
   ======================================== */
.success-message {
    display: none;
    text-align: center;
    padding: var(--spacing-2xl);
    animation: fadeInScale 0.5s ease-out;
}

.success-message.show {
    display: block;
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-lg);
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
    animation: scaleIn 0.5s ease-out 0.2s both;
}

.success-icon svg {
    width: 40px;
    height: 40px;
    stroke: white;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.success-message h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--success);
    margin-bottom: var(--spacing-md);
}

.success-message p {
    color: var(--gray-600);
    margin-bottom: var(--spacing-xl);
    line-height: 1.8;
}

.registration-code {
    background: var(--gray-50);
    border: 2px dashed var(--accent-gold);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.registration-code span {
    display: block;
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-xs);
}

.registration-code strong {
    display: block;
    font-size: 1.75rem;
    font-family: 'Courier New', monospace;
    color: var(--primary-dark);
    letter-spacing: 3px;
}

.btn-secondary {
    padding: var(--spacing-md) var(--spacing-xl);
    background: var(--white);
    color: var(--primary-dark);
    border: 2px solid var(--primary-dark);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-secondary:hover {
    background: var(--primary-dark);
    color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   ERROR ALERT
   ======================================== */
.error-alert {
    display: none;
    background: var(--error-light);
    border: 2px solid var(--error);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    position: relative;
    animation: slideDown 0.3s ease-out;
}

.error-alert.show {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.error-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.error-content {
    flex: 1;
}

.error-content strong {
    display: block;
    color: var(--error);
    font-size: 1.125rem;
    margin-bottom: var(--spacing-xs);
}

.error-content p {
    color: var(--gray-700);
    font-size: 0.95rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--error);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.close-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    text-align: center;
    margin-top: var(--spacing-2xl);
    padding-top: var(--spacing-xl);
    color: var(--gray-300);
    font-size: 0.875rem;
}

.footer-link {
    margin-top: var(--spacing-sm);
}

.footer-link a {
    color: var(--accent-gold);
    text-decoration: none;
    transition: color var(--transition-base);
}

.footer-link a:hover {
    color: var(--accent-gold-light);
    text-decoration: underline;
}

.powered-by {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    opacity: 0.8;
    transition: opacity var(--transition-base);
}

.powered-by:hover {
    opacity: 1;
}

.powered-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.powered-link {
    display: inline-block;
    text-decoration: none;
    line-height: 0;
}

.powered-logo {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
    /* Make it white */
    opacity: 0.7;
    transition: all var(--transition-base);
}

.powered-logo:hover {
    opacity: 1;
    transform: scale(1.05);
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
    .container {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .title {
        font-size: 1.5rem;
    }

    .title-arabic {
        font-size: 1.25rem;
    }

    .form-container {
        padding: var(--spacing-xl) var(--spacing-lg);
    }

    .form-header h3 {
        font-size: 1.5rem;
    }

    .event-details {
        font-size: 0.875rem;
    }

    .detail-item {
        flex-direction: column;
        text-align: center;
    }
}

/* ========================================
   POWERED BY SECTION
   ======================================== */
.powered-by {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
    padding: var(--spacing-sm) 0;
    /* Removed background and border */
}

.powered-label {
    font-size: 0.75rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.powered-link {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.powered-link:hover {
    transform: scale(1.05);
}

.powered-logo {
    max-height: 40px;
    max-width: 120px;
    height: auto;
    width: auto;
    /* NO FILTER - Show original logo colors */
    filter: none !important;
    transition: all 0.3s ease;
}

.powered-logo:hover {
    opacity: 0.9;
}

@media (max-width: 480px) {
    .logo {
        max-width: 250px;
    }

    .form-container {
        padding: var(--spacing-lg);
    }

    .submit-btn {
        width: 100%;
        justify-content: center;
        font-size: 1rem;
        padding: var(--spacing-md);
    }

    .language-toggle {
        top: 15px;
        right: 15px;
        padding: 3px;
    }

    .lang-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}