/* ==========================================================================
   TWINX GALAXY FORMS & DASHBOARD DESIGN SYSTEM (V3 - OVERLAP FIX & TOP RADAR)
   ========================================================================== */

@font-face {
    font-family: 'ZainCustomFont';
    src: url('https://flow.twinxeg.com/alfont_com_zainpcv2mob300-zainpcv2.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-deep: #020409;
    --twinx-orange: #ff6b00;
    --twinx-amber: #f97316;
    --twinx-cyan: #06b6d4;
    --twinx-blue: #3b82f6;
    --twinx-purple: #8b5cf6;
    --twinx-emerald: #10b981;
    --twinx-rose: #ec4899;
    
    --active-accent: #f97316;
    --active-glow: rgba(249, 115, 22, 0.35);

    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --font-ar: 'ZainCustomFont', 'Cairo', system-ui, -apple-system, sans-serif;
    --font-en: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-ar);
    font-size: 17px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* 3D WebGL Background Canvas */
#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
}

/* Application UI Root Layer */
#app-ui {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Navbar */
header.galaxy-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(2, 4, 9, 0.96) 0%, rgba(2, 4, 9, 0) 100%);
    backdrop-filter: blur(16px);
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-logo-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.logo-full-img {
    height: 42px;
    object-fit: contain;
    filter: drop-shadow(0 0 12px var(--active-glow));
    transition: filter 0.5s ease;
}

.header-badge {
    padding: 4px 14px;
    border-radius: 20px;
    background: rgba(249, 115, 22, 0.15);
    border: 1px solid var(--twinx-amber);
    color: var(--twinx-amber);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* Main Container Layout */
.main-wrapper {
    flex: 1;
    padding: 110px 20px 80px 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Glassmorphic Form Card */
.form-container-card {
    width: 100%;
    max-width: 860px;
    background: linear-gradient(145deg, rgba(10, 16, 30, 0.85) 0%, rgba(2, 4, 9, 0.92) 100%);
    backdrop-filter: blur(24px);
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    padding: 40px 48px 50px 48px;
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
}

.form-container-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 40px;
    width: 90px;
    height: 4px;
    background: var(--active-accent);
    border-radius: 4px;
    box-shadow: 0 0 20px var(--active-accent);
}

/* Screen Title & Descriptions */
.hero-welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 20px;
    background: var(--active-glow);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.form-hero-title {
    font-size: 2.5rem;
    font-weight: 1000;
    line-height: 1.25;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffffff 40%, var(--active-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-hero-desc {
    font-size: 1.12rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
}

.privacy-notice-box {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 16px;
    padding: 14px 20px;
    font-size: 0.92rem;
    color: #cff4fc;
    line-height: 1.6;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.privacy-notice-box i {
    font-size: 1.2rem;
    color: var(--twinx-cyan);
    margin-top: 2px;
}

/* TOP RADAR STEP TRACKER (FIXED POSITIONING OVERLAP REMOVED COMPLETELY) */
.galaxy-radar {
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    transform: none;
    background: rgba(10, 16, 30, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
    margin-bottom: 20px;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.galaxy-radar::-webkit-scrollbar {
    display: none;
}

.radar-node {
    padding: 8px 16px;
    border-radius: 14px;
    font-size: 0.88rem;
    font-weight: 800;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.radar-node.active, .radar-node:hover {
    color: #ffffff;
    background: var(--active-glow);
    border-color: var(--active-accent);
    box-shadow: 0 0 15px var(--active-glow);
}

/* Step Wizard Progress Bar */
.wizard-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 35px;
    position: relative;
}

.wizard-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--twinx-orange), var(--twinx-amber));
    border-radius: 10px;
    box-shadow: 0 0 15px var(--twinx-amber);
    transition: width 0.4s ease;
}

/* Form Steps Layout */
.form-step {
    display: none;
    animation: fadeInStep 0.4s ease forwards;
}

.form-step.active-step {
    display: block;
}

@keyframes fadeInStep {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-section-title {
    font-size: 1.6rem;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-section-subtitle {
    font-size: 0.98rem;
    color: var(--text-muted);
    margin-bottom: 28px;
}

/* Form Field Groups */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
}

.form-label .req {
    color: var(--twinx-rose);
    margin-right: 4px;
}

.form-label .opt {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: normal;
    margin-right: 6px;
}

.form-help-text {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.5;
}

/* Input Fields Styling */
.form-control {
    width: 100%;
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-family: var(--font-ar);
    font-size: 1.02rem;
    outline: none;
    transition: all 0.3s ease;
}

.form-control:focus {
    background: rgba(15, 23, 42, 0.9);
    border-color: var(--active-accent);
    box-shadow: 0 0 20px var(--active-glow);
}

textarea.form-control {
    min-height: 110px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 16px center;
    padding-left: 45px;
}

/* Custom Grid Select Cards (Radio & Checkbox Cards) */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-top: 10px;
}

.option-card-label {
    position: relative;
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-card-label:hover {
    background: var(--active-glow);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.option-card-label input[type="radio"],
.option-card-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.option-card-label.selected,
.option-card-label input:checked + .card-text-wrap {
    background: var(--active-glow);
    border-color: var(--active-accent);
    color: #ffffff;
    box-shadow: 0 0 15px var(--active-glow);
}

.option-card-label .card-icon {
    margin-left: 10px;
    font-size: 1.1rem;
    color: var(--twinx-amber);
}

/* Drag & Drop File Upload Zone */
.file-drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    background: rgba(15, 23, 42, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.file-drop-zone:hover, .file-drop-zone.dragover {
    border-color: var(--twinx-amber);
    background: var(--active-glow);
    box-shadow: 0 0 25px var(--active-glow);
}

.file-drop-icon {
    font-size: 2.5rem;
    color: var(--twinx-amber);
    margin-bottom: 12px;
}

.file-list-preview {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item-chip {
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(249, 115, 22, 0.15);
    border: 1px solid var(--twinx-amber);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #ffffff;
}

/* Form Action Buttons Bar (Clean Bottom Spacing) */
.form-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-galaxy {
    padding: 13px 28px;
    border-radius: 16px;
    font-family: var(--font-ar);
    font-size: 1.05rem;
    font-weight: 800;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-galaxy-primary {
    background: linear-gradient(135deg, var(--twinx-orange), var(--twinx-amber));
    color: #ffffff;
    box-shadow: 0 8px 25px var(--active-glow);
}

.btn-galaxy-primary:hover {
    box-shadow: 0 12px 35px var(--active-accent);
    transform: translateY(-2px);
}

.btn-galaxy-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.btn-galaxy-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Repeater Item Boxes */
.repeater-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.repeater-item-box {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 20px;
    position: relative;
}

.btn-remove-repeater {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(236, 72, 153, 0.2);
    border: 1px solid var(--twinx-rose);
    color: var(--twinx-rose);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Success Screen View */
.success-screen-box {
    text-align: center;
    padding: 40px 20px;
}

.success-glow-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.2);
    border: 2px solid var(--twinx-emerald);
    color: var(--twinx-emerald);
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px auto;
    box-shadow: 0 0 35px rgba(16, 185, 129, 0.4);
}

/* ==========================================================================
   ADMIN DASHBOARD STYLES
   ========================================================================== */

.admin-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.admin-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 16px;
}

.admin-tabs-nav {
    display: flex;
    gap: 10px;
    background: rgba(15, 23, 42, 0.6);
    padding: 6px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-btn {
    padding: 10px 24px;
    border-radius: 14px;
    font-family: var(--font-ar);
    font-size: 1rem;
    font-weight: 800;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--active-glow);
    color: #ffffff;
    border: 1px solid var(--active-accent);
    box-shadow: 0 0 15px var(--active-glow);
}

.client-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.client-card {
    background: rgba(10, 16, 30, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 24px;
    backdrop-filter: blur(16px);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.client-card:hover {
    border-color: var(--active-accent);
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 20px var(--active-glow);
}

.client-card-title {
    font-size: 1.3rem;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 4px;
}

.client-card-sub {
    font-size: 0.92rem;
    color: var(--twinx-amber);
    margin-bottom: 14px;
    font-weight: 800;
}

.client-meta-row {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Modal Client View */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(2, 4, 9, 0.85);
    backdrop-filter: blur(20px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-glass-card {
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    background: linear-gradient(145deg, rgba(10, 16, 30, 0.95) 0%, rgba(2, 4, 9, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 32px;
    padding: 36px;
    overflow-y: auto;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.9);
}

.modal-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 18px;
    margin-bottom: 24px;
}

.btn-close-modal {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
}

.view-data-group {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 16px;
}

.view-data-label {
    font-size: 0.9rem;
    color: var(--twinx-amber);
    font-weight: 800;
    margin-bottom: 6px;
}

.view-data-val {
    font-size: 1.08rem;
    color: #ffffff;
    line-height: 1.6;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    header.galaxy-header { padding: 14px 20px; }
    .form-container-card { padding: 28px 20px; border-radius: 24px; }
    .form-hero-title { font-size: 1.9rem; }
    .options-grid { grid-template-columns: 1fr; }
    .form-actions-bar { flex-direction: column-reverse; gap: 12px; }
    .btn-galaxy { width: 100%; justify-content: center; }
}
