@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400&family=Inter:wght@300;400;500;600&display=swap');

:root {
    --bg-color: #f6f4f0;
    --text-color: #1c1c1b;
    --text-muted: #8c8984;
    --input-border: #c8c5c0;
    --accent-color: #000000;
    --font-serif: 'Cinzel', 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
    --error-color: #b73a1b;
    --success-bg: #f3f6f1;
    --success-border: #d4ebc6;
    --success-text: #4a7c2c;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: opacity 0.5s ease;
}

/* RTL Specific Rules automatically activated when dir="rtl" */
[dir="rtl"] {
    font-family: 'Inter', sans-serif; /* For Arabic, Inter is perfect for body, headings can be customized */
}

/* Base Wrapper */
.app-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 30px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* --- Header Section --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 60px;
    z-index: 10;
}

/* Premium Logo styling matching image */
.logo-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-decoration: none;
    color: var(--text-color);
    cursor: pointer;
}

[dir="rtl"] .logo-container {
    align-items: flex-start; /* Keep left alignment as per screenshot showing it on top left */
}

.logo-r {
    font-family: 'Cinzel', serif;
    font-size: 76px;
    font-weight: 300;
    line-height: 0.8;
    letter-spacing: -2px;
    color: var(--text-color);
    user-select: none;
}

.logo-line {
    width: 125px;
    border-bottom: 1.5px solid var(--text-color);
    margin: 4px 0 8px 0;
}

.logo-text {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--text-color);
    text-transform: uppercase;
    font-family: var(--font-sans);
}

/* Language Selector */
.lang-switcher {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 2px;
    display: flex;
    gap: 8px;
    cursor: pointer;
    align-items: center;
}

.lang-btn {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
}

.lang-btn:hover {
    color: var(--text-color);
}

.lang-btn.active {
    color: var(--text-color);
    font-weight: 600;
}

.lang-separator {
    color: var(--text-muted);
}

.admin-lock-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    text-decoration: none;
    transition: opacity 0.3s;
}

.admin-lock-btn:hover {
    opacity: 0.6;
}

.lock-icon {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

/* --- Cover Layout --- */
.cover-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    text-align: center;
    margin: 40px 0 80px 0;
    opacity: 1;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.cover-section.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    position: absolute;
    width: 100%;
    left: 0;
    display: none;
}

.cover-title {
    font-family: 'Cinzel', serif;
    font-size: 54px;
    font-weight: 300;
    letter-spacing: 9px;
    line-height: 1.2;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.cover-subtitle {
    font-family: 'Cinzel', serif;
    font-size: 40px;
    font-weight: 300;
    letter-spacing: 12px;
    line-height: 1;
    margin-bottom: 45px;
    text-transform: uppercase;
}

/* Elegant CTA buttons */
.btn-cta {
    background-color: var(--accent-color);
    color: #ffffff;
    border: none;
    padding: 13px 40px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    font-family: var(--font-sans);
}

.btn-cta:hover {
    background-color: #333333;
}

.btn-cta:active {
    transform: scale(0.98);
}

/* --- Form Layout --- */
.form-section {
    max-width: 460px;
    width: 100%;
    margin: 0 auto 80px auto;
    opacity: 0;
    transform: translateY(20px);
    display: none;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.form-section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Center and style cover elements in Form View */
.form-header {
    text-align: center;
    margin-bottom: 50px;
}

.form-header .cover-title {
    font-size: 42px;
    letter-spacing: 7px;
    margin-bottom: 5px;
}

.form-header .cover-subtitle {
    font-size: 32px;
    letter-spacing: 10px;
    margin-bottom: 0;
}

/* Minimalist Form Elements */
.registration-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
}

.form-group label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 4px;
    transition: color 0.3s;
}

[dir="rtl"] .form-group label {
    text-align: right;
}

.form-group input,
.form-group select {
    border: none;
    border-bottom: 1px solid var(--input-border);
    background-color: transparent;
    color: var(--text-color);
    padding: 8px 0;
    font-size: 15px;
    font-family: var(--font-sans);
    outline: none;
    width: 100%;
    border-radius: 0;
    transition: border-color 0.3s;
}

/* Text alignments */
[dir="rtl"] .form-group input,
[dir="rtl"] .form-group select {
    text-align: right;
}

.form-group input:focus,
.form-group select:focus {
    border-bottom-color: var(--accent-color);
}

/* Select overrides for premium styling */
.form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    padding-right: 20px;
}

[dir="rtl"] .form-group select {
    padding-left: 20px;
    padding-right: 0;
}

.form-group select::-ms-expand {
    display: none;
}

/* Elegant dropdown arrow custom styling */
.select-wrapper {
    position: relative;
    width: 100%;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 14px;
    width: 6px;
    height: 6px;
    border-right: 1px solid var(--text-muted);
    border-bottom: 1px solid var(--text-muted);
    transform: rotate(45deg);
    pointer-events: none;
    transition: transform 0.3s;
}

[dir="rtl"] .select-wrapper::after {
    left: 0;
    right: auto;
}

/* Phone input container with country code select */
.phone-input-container {
    display: flex;
    gap: 15px;
    width: 100%;
    align-items: flex-end;
}

[dir="rtl"] .phone-input-container {
    flex-direction: row-reverse;
}

.phone-code-select {
    width: 110px !important;
    text-align: center;
    border: none;
    border-bottom: 1px solid var(--input-border);
    background: transparent;
    padding: 8px 0;
    font-size: 15px;
    font-family: var(--font-sans);
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
}

.phone-number-field {
    flex-grow: 1;
}

/* Form Submit Button */
.btn-submit {
    background-color: var(--accent-color);
    color: #ffffff;
    border: none;
    padding: 15px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.3s;
    font-family: var(--font-sans);
    width: 100%;
}

.btn-submit:hover {
    background-color: #333333;
}

/* Field errors styling */
.error-msg {
    color: var(--error-color);
    font-size: 11px;
    margin-top: 4px;
    display: none;
}

[dir="rtl"] .error-msg {
    text-align: right;
}

.has-error input,
.has-error select {
    border-bottom-color: var(--error-color) !important;
}

.has-error label {
    color: var(--error-color) !important;
}

/* Required asterisk style */
.required-star {
    color: var(--error-color);
    margin-left: 2px;
}

[dir="rtl"] .required-star {
    margin-right: 2px;
    margin-left: 0;
}

/* Success Screen container inside the same page */
.success-screen {
    display: none;
    text-align: center;
    padding: 50px 20px;
    max-width: 500px;
    margin: 0 auto 80px auto;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.5s ease;
}

.success-screen.active {
    display: block;
    opacity: 1;
    transform: scale(1);
}

.success-icon {
    width: 60px;
    height: 60px;
    background-color: #e9f5e3;
    color: #4a7c2c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 30px auto;
}

.success-title {
    font-family: 'Cinzel', serif;
    font-size: 24px;
    letter-spacing: 2px;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.success-message {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
}

/* --- Footer Section --- */
footer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px 0;
    width: 100%;
    margin-top: auto;
    border-top: 1px solid #eae7e2;
    z-index: 10;
    gap: 15px;
}

.footer-developer {
    text-align: center;
    width: 100%;
}

.developer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    font-family: var(--font-sans);
    letter-spacing: 1px;
    transition: color 0.3s;
}

.developer-link:hover {
    color: var(--text-color);
}

.developer-team {
    color: var(--text-color);
    font-weight: 600;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: color 0.3s;
}

.footer-item:hover {
    color: var(--text-muted);
}

.footer-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* --- Loader Spinner --- */
.submit-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .app-container {
        padding: 20px 15px;
    }
    
    header {
        margin-bottom: 40px;
    }
    
    .logo-r {
        font-size: 60px;
    }
    
    .logo-line {
        width: 100px;
    }
    
    .cover-title {
        font-size: 34px;
        letter-spacing: 5px;
    }
    
    .cover-subtitle {
        font-size: 26px;
        letter-spacing: 7px;
        margin-bottom: 35px;
    }
    
    .footer-content {
        gap: 20px;
        flex-direction: column;
        align-items: center;
    }
    
    .form-header .cover-title {
        font-size: 30px;
        letter-spacing: 4px;
    }
    
    .form-header .cover-subtitle {
        font-size: 22px;
        letter-spacing: 6px;
    }
}

/* --- Event Badge & Closed Page --- */
.event-details-badge {
    margin-bottom: 35px;
    text-align: center;
    background-color: rgba(28, 28, 27, 0.03);
    padding: 12px 25px;
    border-radius: 4px;
    display: inline-block;
}

.event-title-badge {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--text-color);
    margin-bottom: 6px;
}

.event-date-badge {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
}

.closed-registration-container {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: 480px;
    margin: 40px auto 80px auto;
    padding: 50px 30px;
    background: #ffffff;
    border: 1px solid #eae7e2;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.closed-registration-container.active {
    display: flex;
}

.closed-icon {
    width: 60px;
    height: 60px;
    color: var(--text-muted);
    margin-bottom: 25px;
    display: inline-block;
}

.closed-icon svg {
    width: 60px;
    height: 60px;
    max-width: 100%;
    max-height: 100%;
    fill: currentColor;
}

.closed-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 15px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.closed-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Google reCAPTCHA styling and centering alignment */
.recaptcha-form-group {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    width: 100%;
}

.recaptcha-form-group > div {
    display: inline-block;
    max-width: 100%;
}


