/* Affiliate Rider — web (home + legal + registration) */

:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --brand: #0d9488;
    --brand-dark: #0f766e;
    --accent: #2563eb;
    --danger: #dc2626;
    --radius: 16px;
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 24px 48px rgba(15, 23, 42, 0.1);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Tajawal', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    max-width: 100%;
}

a { color: inherit; text-decoration: none; }

.wrap {
    width: min(1120px, 92vw);
    margin-inline: auto;
}

/* Header / nav */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.brand img { height: 36px; width: auto; }

.nav-desktop {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-desktop a:not(.btn) {
    font-weight: 500;
    color: var(--muted);
    transition: color 0.2s;
}

.nav-desktop a:not(.btn):hover { color: var(--brand); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.25rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
    font-family: inherit;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    box-shadow: 0 8px 20px rgba(13, 148, 136, 0.35);
}

.btn-primary:hover { box-shadow: 0 10px 28px rgba(13, 148, 136, 0.45); }

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid rgba(15, 23, 42, 0.12);
}

.btn-ghost:hover { background: rgba(15, 23, 42, 0.04); }

.btn-block { width: 100%; padding: 0.85rem 1.5rem; font-size: 1rem; }

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow);
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
}

.mobile-nav {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 0 1.25rem;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.mobile-nav a {
    padding: 0.65rem 0;
    font-weight: 600;
    color: var(--muted);
}

.mobile-nav .btn { margin-top: 0.5rem; text-align: center; }

body.nav-open .mobile-nav { display: flex; }

@media (max-width: 768px) {
    .nav-desktop { display: none; }
    .nav-toggle { display: flex; }
}

/* Legal pages */
.legal-hero {
    padding: clamp(2rem, 5vw, 3rem) 0 1.5rem;
    position: relative;
    overflow: hidden;
}

.legal-hero::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -35%;
    height: 75%;
    background: radial-gradient(ellipse 55% 45% at 50% 0%, rgba(13, 148, 136, 0.12), transparent 70%);
    pointer-events: none;
}

.legal-hero-inner { position: relative; }

.legal-breadcrumb {
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.legal-breadcrumb a { color: var(--brand); font-weight: 600; }

.legal-breadcrumb a:hover { text-decoration: underline; }

.legal-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.legal-meta {
    font-size: 0.9rem;
    color: var(--muted);
}

.legal-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(15, 23, 42, 0.06);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    margin-bottom: 2.5rem;
}

.legal-prose { max-width: 48rem; }

.legal-prose h2 {
    font-size: 1.15rem;
    font-weight: 800;
    margin-top: 1.75rem;
    margin-bottom: 0.65rem;
    color: var(--text);
    padding-bottom: 0.35rem;
    border-bottom: 2px solid rgba(13, 148, 136, 0.2);
}

.legal-prose h2:first-child { margin-top: 0; }

.legal-prose p {
    margin-bottom: 1rem;
    color: var(--text);
}

.legal-prose ul {
    margin: 0 0 1rem 0;
    padding-inline-start: 1.35rem;
    color: var(--text);
}

.legal-prose li { margin-bottom: 0.5rem; }

.legal-prose strong { font-weight: 700; color: var(--text); }

.legal-note {
    margin-top: 1.5rem;
    padding: 1rem 1.15rem;
    border-radius: 12px;
    background: rgba(13, 148, 136, 0.08);
    border: 1px solid rgba(13, 148, 136, 0.15);
    font-size: 0.9rem;
    color: var(--muted);
}

/* Registration */
.page-hero {
    padding: clamp(2rem, 5vw, 2.75rem) 0 1.25rem;
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -35%;
    height: 75%;
    background: radial-gradient(ellipse 55% 45% at 50% 0%, rgba(13, 148, 136, 0.12), transparent 70%);
    pointer-events: none;
}

.page-hero-inner { position: relative; }

.breadcrumb {
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.breadcrumb a { color: var(--brand); font-weight: 600; }

.breadcrumb a:hover { text-decoration: underline; }

.page-hero h1 {
    font-size: clamp(1.65rem, 4vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.page-lead {
    font-size: 1rem;
    color: var(--muted);
    max-width: 36rem;
}

.form-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(15, 23, 42, 0.06);
    padding: clamp(1.5rem, 4vw, 2.25rem);
    margin-bottom: 2.5rem;
    max-width: 40rem;
}

.alert-success {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    border-radius: 12px;
    background: rgba(13, 148, 136, 0.1);
    border: 1px solid rgba(13, 148, 136, 0.25);
    color: var(--brand-dark);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.alert-success svg { flex-shrink: 0; margin-top: 2px; }

.form-grid { display: grid; gap: 1.15rem; }

@media (min-width: 560px) {
    .form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
}

.field label {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.field label .req { color: var(--danger); font-weight: 800; }

.field-hint {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.35rem;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    font-family: inherit;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.field textarea { min-height: 7rem; resize: vertical; }

.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: var(--danger); }

.field-error {
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 0.35rem;
    font-weight: 600;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-top: 0.25rem;
}

.check-row input {
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.2rem;
    accent-color: var(--brand);
    flex-shrink: 0;
}

.check-row label {
    font-weight: 500;
    margin: 0;
    line-height: 1.5;
}

.check-row a { color: var(--brand); font-weight: 700; text-decoration: underline; }

/* Home */
.hero {
    position: relative;
    padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(4rem, 10vw, 6rem);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -35%;
    height: 85%;
    background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(13, 148, 136, 0.14), transparent 70%);
    pointer-events: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
    position: relative;
}

@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; text-align: center; }
    .hero-actions { justify-content: center; flex-wrap: wrap; }
    .hero-badges { justify-content: center; }
}

.hero-eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand);
    margin-bottom: 0.75rem;
}

.hero h1 {
    font-size: clamp(1.85rem, 4.5vw, 2.75rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.hero h1 span {
    background: linear-gradient(120deg, var(--brand), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-lead {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 32rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
    .hero-lead { margin-inline: auto; }
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(13, 148, 136, 0.1);
    color: var(--brand-dark);
}

.hero-visual { position: relative; }

.hero-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
    transform: perspective(800px) rotateY(-6deg) rotateX(4deg);
    transition: transform 0.4s ease;
}

.hero-card:hover {
    transform: perspective(800px) rotateY(-2deg) rotateX(2deg);
}

@media (max-width: 900px) {
    .hero-card { transform: none; }
    .hero-card:hover { transform: none; }
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.stat-num {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--brand);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
}

.mini-chart {
    height: 120px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.08), rgba(13, 148, 136, 0.06));
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding: 1rem 0.75rem;
    gap: 6px;
}

.bar {
    flex: 1;
    max-width: 28px;
    border-radius: 6px 6px 2px 2px;
    background: linear-gradient(180deg, var(--accent), var(--brand));
    opacity: 0.85;
    animation: web-bar-grow 1.2s ease-out backwards;
}

.bar:nth-child(1) { height: 45%; animation-delay: 0.1s; }
.bar:nth-child(2) { height: 72%; animation-delay: 0.2s; }
.bar:nth-child(3) { height: 55%; animation-delay: 0.3s; }
.bar:nth-child(4) { height: 88%; animation-delay: 0.4s; }
.bar:nth-child(5) { height: 62%; animation-delay: 0.5s; }

@keyframes web-bar-grow {
    from { height: 0; opacity: 0; }
}

section { padding: clamp(3rem, 6vw, 5rem) 0; }

.section-head {
    text-align: center;
    max-width: 36rem;
    margin: 0 auto 2.75rem;
}

.section-head h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    margin-bottom: 0.65rem;
    letter-spacing: -0.02em;
}

.section-head p { color: var(--muted); font-size: 1.05rem; }

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

@media (max-width: 900px) {
    .features { grid-template-columns: 1fr; }
}

.feature-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem 1.35rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(15, 23, 42, 0.05);
    transition: box-shadow 0.25s, border-color 0.25s;
}

.feature-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(13, 148, 136, 0.2);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.15), rgba(37, 99, 235, 0.1));
    color: var(--brand-dark);
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--muted);
}

.steps {
    background: var(--surface);
    border-radius: calc(var(--radius) + 4px);
    box-shadow: var(--shadow);
    border: 1px solid rgba(15, 23, 42, 0.05);
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.steps-inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    counter-reset: web-step;
}

@media (max-width: 900px) {
    .steps-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
    .steps-inner { grid-template-columns: 1fr; }
}

.step {
    position: relative;
    padding-top: 0.5rem;
}

.step::before {
    counter-increment: web-step;
    content: counter(web-step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    margin-bottom: 0.85rem;
}

.step h3 {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
}

.step p { font-size: 0.9rem; color: var(--muted); }

.cta {
    text-align: center;
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 40%, #2563eb 100%);
    border-radius: calc(var(--radius) + 8px);
    padding: clamp(2.5rem, 6vw, 4rem) 1.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.cta::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.9;
    pointer-events: none;
}

.cta h2 {
    font-size: clamp(1.4rem, 3vw, 1.85rem);
    font-weight: 800;
    margin-bottom: 0.65rem;
    position: relative;
}

.cta p {
    opacity: 0.92;
    margin-bottom: 1.35rem;
    max-width: 28rem;
    margin-inline: auto;
    position: relative;
}

.cta .btn {
    background: #fff;
    color: var(--brand-dark);
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.cta .btn:hover { box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2); }

/* Footer */
.site-footer {
    padding: 2rem 0 2.5rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    margin-top: 2rem;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.footer-links a:hover { color: var(--brand); }
