:root {
    --bg-main: #0a0a0c;
    --bg-card: #141418;
    --bg-glass: rgba(20, 20, 24, 0.85);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-main: #ffffff;
    --text-muted: #D1D5DB;
    --text-dim: #8a8a9a;
    --accent-gold: #D4AF37;
    --accent-gold-hover: #b5952f;
    --transition-speed: 0.4s;
    --font-main: 'Cairo', sans-serif;
    --danger: #ef4444;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; }

body {
    background: radial-gradient(circle at center, #1a1a1e 0%, var(--bg-main) 100%);
    color: var(--text-main);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: #2a2a30;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #44444c;
}

/* NAVBAR */
.navbar {
    height: 80px;
    padding: 0 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-glass);
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}
.logo img { height: 42px; width: auto; }
.lang-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    width: 44px; height: 44px;
    border-radius: 50%;
    color: var(--text-main);
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-main);
}
.lang-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-gold);
}

/* MAIN CONTAINER */
.container {
    max-width: 1200px; /* Increased for wider laptop view */
    margin: 40px auto;
    padding: 0 5%;
    display: flex;
    gap: 32px;
}

.form-wrapper {
    flex: 1;
    min-width: 0;
    counter-reset: section;
}

/* STICKY PRICE PANEL */
.price-panel-wrapper {
    width: 300px;
    flex-shrink: 0;
}
.price-panel {
    position: sticky;
    top: 100px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}
.price-panel h3 { color: var(--accent-gold); font-size: 1.2rem; font-weight: 800; margin-bottom: 16px; border-bottom: 1px solid var(--border-glass); padding-bottom: 8px;}
.price-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 0.95rem; color: var(--text-muted); }
.price-row.total { font-weight: 800; color: var(--text-main); font-size: 1.1rem; border-top: 1px solid var(--border-glass); padding-top: 12px; margin-top: 4px;}
.price-row.vat { font-size: 0.85rem; color: var(--text-dim); }

/* ALERTS / CALLOUTS */
.alert-box {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--accent-gold);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 32px;
}
.alert-box.danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
}
.alert-box h4 {
    color: var(--accent-gold);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-box.danger h4 { color: var(--danger); }
.alert-box p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* FORM CARDS */
.form-section {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    display: none; /* Hidden by default until tier selected */
}
.form-section.visible {
    display: block;
    counter-increment: section;
}
.form-section h2 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-main);
}
.form-section h2::before {
    content: counter(section, upper-alpha) ". ";
}
.form-section > p.desc {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 24px;
}

/* FORM FIELDS */
.input-group {
    margin-bottom: 20px;
}
.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}
.input-group label .req { color: var(--accent-gold); }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select, textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    padding: 14px 16px;
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    transition: 0.3s;
}
select option {
    background: var(--bg-card);
    color: var(--text-main);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-gold);
    background: rgba(255, 255, 255, 0.06);
}
.help-text {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 6px;
    display: block;
}
.warning-text {
    font-size: 0.8rem;
    color: var(--accent-gold);
    margin-top: 6px;
    display: none;
}

/* TIER PICKER */
.tier-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
.tier-card {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--border-glass);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
}
.tier-card:hover { border-color: rgba(212, 175, 55, 0.5); }
.tier-card.selected {
    border-color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.1);
}
.tier-card h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 8px; }
.tier-card p { font-size: 0.85rem; color: var(--text-muted); }

/* BUTTONS */
.btn-gold {
    background: var(--accent-gold);
    color: #000;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
    font-family: var(--font-main);
}
.btn-gold:hover { background: var(--accent-gold-hover); transform: translateY(-2px); }
.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-glass);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.3s;
}
.btn-outline:hover { background: rgba(255, 255, 255, 0.1); }

/* TABLES / REPEATABLE */
.repeatable-item {
    background: rgba(0,0,0,0.2);
    border: 1px dashed var(--border-glass);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    position: relative;
}
.remove-btn {
    position: absolute;
    top: 10px; right: 10px;
    background: none; border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 0.9rem;
}

/* FOOTER */
footer {
    padding: 40px 20px;
    text-align: center;
    border-top: 1px solid var(--border-glass);
    margin-top: 60px;
}
footer img { height: 28px; margin-bottom: 16px; opacity: 0.5; }
footer p { color: var(--text-dim); font-size: 0.8rem; line-height: 1.7; opacity: 0.7; }

/* LOADING OVERLAY */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 10, 12, 0.9);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center; justify-content: center;
    flex-direction: column;
}
.spinner {
    width: 40px; height: 40px;
    border: 4px solid var(--border-glass);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* RTL SUPPORT & BILINGUAL TOGGLE */
html:not([lang="ar"]) .lang-ar { display: none !important; }
html[lang="ar"] .lang-en { display: none !important; }

html[dir="rtl"] {
    font-family: 'Cairo', sans-serif;
}
html[dir="rtl"] .remove-btn {
    right: auto; left: 10px;
}
html[dir="rtl"] .input-group label {
    font-weight: 700;
}
html[dir="rtl"] .btn-gold, html[dir="rtl"] .btn-outline {
    font-weight: 700;
}

@media (max-width: 768px) {
    .container { flex-direction: column; }
    .price-panel-wrapper { width: 100%; }
    .price-panel { position: static; }
    .tier-picker { grid-template-columns: 1fr; }
    .input-row { grid-template-columns: 1fr; }
}
