/* ============================================
   JAMMAL - جمّال | Premium Saudi Freight Platform
   Deep Navy + Golden Bronze "Saudi Tech" Design
   ============================================ */

/* ── Reset & Base ─────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy: #1B2A4A;
    --navy-light: #2D4A7A;
    --navy-dark: #0F1A2E;
    --gold: #C8973E;
    --gold-light: #D4AD5E;
    --gold-dark: #A67B2E;
    --bg: #F7F6F2;
    --bg-alt: #EDECE8;
    --surface: #FFFFFF;
    --text: #1B2A4A;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --border: #E5E7EB;
    --border-light: #F3F4F6;
    --success: #10B981;
    --error: #EF4444;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
img { max-width: 100%; display: block; }

/* ── Buttons ──────────────────────────── */
.btn-accent {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gold);
    color: #FFF;
    font-weight: 700;
    font-size: 16px;
    padding: 14px 32px;
    border-radius: var(--radius);
    border: 2px solid var(--gold);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.btn-accent:hover {
    background: var(--gold-dark);
    border-color: var(--gold-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(200,151,62,0.35);
}

.btn-outline-light {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: #FFF;
    font-weight: 700;
    font-size: 16px;
    padding: 14px 32px;
    border-radius: var(--radius);
    border: 2px solid rgba(255,255,255,0.5);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.btn-outline-light:hover {
    background: rgba(255,255,255,0.1);
    border-color: #FFF;
    transform: translateY(-2px);
}

.btn-outline-dark {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--navy);
    font-weight: 700;
    font-size: 16px;
    padding: 14px 32px;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.btn-outline-dark:hover {
    border-color: var(--navy);
    background: var(--navy);
    color: #FFF;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--gold);
    font-weight: 700;
    font-size: 16px;
    padding: 12px 28px;
    border-radius: var(--radius);
    border: 2px solid var(--gold);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.btn-outline:hover {
    background: var(--gold);
    color: #FFF;
}

.btn-primary-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--navy);
    color: #FFF;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 22px;
    border-radius: var(--radius);
    border: 2px solid var(--navy);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.btn-primary-sm:hover {
    background: var(--navy-light);
    border-color: var(--navy-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-text {
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    padding: 10px 16px;
    border-radius: var(--radius);
    transition: var(--transition);
}
.btn-text:hover { background: var(--bg-alt); }

/* ── Navbar ───────────────────────────── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}
.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.navbar-logo { display: flex; align-items: center; }
.logo-img { height: 48px; width: auto; }

.navbar-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    font-weight: 600;
    font-size: 15px;
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
}
.nav-link:hover { color: var(--text); background: var(--bg-alt); }

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: var(--bg-alt);
    border-radius: 10px;
    cursor: pointer;
    color: var(--text);
}

.mobile-menu {
    display: none;
    flex-direction: column;
    padding: 16px 24px 24px;
    border-top: 1px solid var(--border-light);
    background: var(--surface);
}
.mobile-menu.open { display: flex; }
.mobile-link {
    padding: 14px 0;
    font-weight: 600;
    font-size: 16px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}
.mobile-link:hover { color: var(--text); }
.mobile-divider { height: 1px; background: var(--border); margin: 8px 0; }
.mobile-btn { text-align: center; margin-top: 12px; }

/* ── Hero ─────────────────────────────── */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('../images/hero-bg.png') center/cover no-repeat;
    padding: 120px 24px 60px;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(15,26,46,0.85) 0%,
        rgba(27,42,74,0.8) 50%,
        rgba(15,26,46,0.9) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
}

.hero-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    filter: drop-shadow(0 4px 20px rgba(0,0,0,0.3));
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(200,151,62,0.15);
    border: 1px solid rgba(200,151,62,0.3);
    color: var(--gold-light);
    font-weight: 600;
    font-size: 14px;
    padding: 8px 20px;
    border-radius: 50px;
    margin-bottom: 24px;
}
.hero-badge .material-icons-round { font-size: 18px; }

.hero-title {
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 900;
    color: #FFF;
    line-height: 1.3;
    margin-bottom: 20px;
}

.hero-highlight {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 18px;
    color: rgba(255,255,255,0.75);
    line-height: 1.8;
    margin-bottom: 36px;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.hero-ctas {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    color: rgba(255,255,255,0.4);
    animation: bounce 2s infinite;
}
.hero-scroll-indicator .material-icons-round { font-size: 36px; }

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

/* ── Sections ─────────────────────────── */
.section { padding: 100px 0; }

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
}

/* ── How It Works ─────────────────────── */
.how-it-works { background: var(--surface); }

.steps-grid {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
}

.step-card {
    flex: 0 1 220px;
    text-align: center;
    padding: 24px 16px;
    position: relative;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gold);
    color: #FFF;
    font-weight: 800;
    font-size: 16px;
    margin: 0 auto 16px;
}

.step-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(27,42,74,0.06), rgba(27,42,74,0.12));
    margin: 0 auto 16px;
    transition: var(--transition);
}
.step-card:hover .step-icon-wrapper {
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
}
.step-icon-wrapper .material-icons-round {
    font-size: 32px;
    color: var(--navy);
    transition: var(--transition);
}
.step-card:hover .step-icon-wrapper .material-icons-round { color: #FFF; }

.step-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--navy);
}

.step-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.step-connector {
    display: flex;
    align-items: center;
    padding-top: 70px;
    color: var(--text-muted);
}
.step-connector .material-icons-round { font-size: 24px; }

/* ── Features ─────────────────────────── */
.features { background: var(--bg); }

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.feature-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    text-align: center;
    border: 1px solid var(--border-light);
    transition: var(--transition);
}
.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(200,151,62,0.08), rgba(200,151,62,0.16));
    margin: 0 auto 20px;
}
.feature-icon .material-icons-round {
    font-size: 30px;
    color: var(--gold);
}

.feature-title {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--navy);
}

.feature-desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ── Quote Form ───────────────────────── */
.quote-section { background: var(--surface); }

.quote-form-wrapper {
    max-width: 750px;
    margin: 0 auto;
    background: var(--bg);
    border-radius: var(--radius-xl);
    padding: 40px;
    border: 1px solid var(--border);
}

.quote-form { display: flex; flex-direction: column; gap: 28px; }

.form-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--navy);
}
.form-section-title .material-icons-round { font-size: 22px; color: var(--gold); }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group.full-width { grid-column: 1 / -1; }

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    transition: var(--transition);
    outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(200,151,62,0.12);
}
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group textarea { resize: vertical; min-height: 80px; }

.btn-submit {
    width: 100%;
    font-size: 18px;
    padding: 16px;
    border-radius: var(--radius);
    justify-content: center;
}

.form-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    justify-content: center;
}
.form-note .material-icons-round { font-size: 16px; }

.form-success {
    text-align: center;
    padding: 40px;
}
.success-icon { font-size: 64px; color: var(--success); }
.form-success h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--navy);
    margin: 16px 0 8px;
}
.form-success p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ── CTA Section ──────────────────────── */
.cta-section {
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
    text-align: center;
    padding: 80px 0;
}

.cta-title {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    color: #FFF;
    margin-bottom: 12px;
}

.cta-subtitle {
    font-size: 18px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 36px;
}

.cta-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.cta-section .btn-outline-dark {
    color: #FFF;
    border-color: rgba(255,255,255,0.3);
}
.cta-section .btn-outline-dark:hover {
    background: rgba(255,255,255,0.1);
    border-color: #FFF;
    color: #FFF;
}

/* ── Footer ───────────────────────────── */
.footer {
    background: var(--navy-dark);
    color: rgba(255,255,255,0.8);
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo { height: 48px; margin-bottom: 16px; filter: brightness(0) invert(1); }

.footer-desc {
    font-size: 14px;
    line-height: 1.8;
    color: rgba(255,255,255,0.6);
}

.footer-col h4 {
    font-size: 15px;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 16px;
}

.footer-col a {
    display: block;
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    padding: 5px 0;
    transition: var(--transition);
}
.footer-col a:hover { color: var(--gold-light); padding-right: 4px; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}

/* ── Toast ─────────────────────────────── */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--navy);
    color: #FFF;
    padding: 14px 28px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--error); }
.toast.success { background: var(--success); }

/* ── Animations ───────────────────────── */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s forwards;
}
.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }
.delay-4 { animation-delay: 0.6s; }
.delay-5 { animation-delay: 0.9s; }

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

/* Scroll-reveal for sections */
.step-card, .feature-card {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s, transform 0.6s;
}
.step-card.visible, .feature-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Loading spinner for button ─────── */
.btn-submit.loading {
    pointer-events: none;
    opacity: 0.7;
}
.btn-submit.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #FFF;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Auth Pages ───────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 40px 24px;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.auth-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
}

.auth-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: right;
}

.auth-form .form-group { margin-bottom: 0; }

.auth-btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    margin-top: 8px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-link {
    font-size: 14px;
    color: var(--text-secondary);
}
.auth-link a {
    color: var(--gold);
    font-weight: 700;
}
.auth-link a:hover { text-decoration: underline; }

.role-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 8px;
}

.role-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}
.role-option .material-icons-round { font-size: 28px; }
.role-option:hover { border-color: var(--gold); color: var(--gold); }
.role-option.active {
    border-color: var(--gold);
    background: rgba(200,151,62,0.08);
    color: var(--gold);
}

.phone-input-wrapper {
    display: flex;
    gap: 10px;
}
.phone-prefix {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 14px;
    background: var(--bg-alt);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
}
.phone-prefix span { font-size: 20px; }

/* OTP Section */
.otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    direction: ltr;
}
.otp-input {
    width: 52px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}
.otp-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,151,62,0.12); }

.resend-timer {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 16px;
}
.resend-btn {
    background: none;
    border: none;
    color: var(--gold);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
}
.resend-btn:disabled { color: var(--text-muted); cursor: not-allowed; }

/* ── Responsive ───────────────────────── */
@media (max-width: 900px) {
    .features-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
    .step-connector { display: none; }
    .steps-grid { flex-direction: column; align-items: center; gap: 8px; }
    .step-card { flex: auto; max-width: 400px; }
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .navbar-links, .navbar-actions { display: none; }
    .menu-toggle { display: flex; }
    .hero { padding: 100px 20px 50px; min-height: 90vh; }
    .hero-title { font-size: 28px; }
    .hero-subtitle { font-size: 16px; }
    .hero-logo { width: 90px; height: 90px; }
    .section { padding: 60px 0; }
    .quote-form-wrapper { padding: 24px; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
    .cta-buttons { flex-direction: column; }
    .auth-card { padding: 32px 24px; }
    .role-selector { grid-template-columns: 1fr; }
}
