/* ===========================================================================
   AstroChart - base styles (RTL/LTR aware, responsive)
   =========================================================================== */

:root {
    --bg: #f6f4fb;
    --surface: #ffffff;
    --ink: #1f1b2e;
    --muted: #6b6480;
    --primary: #6d4ed1;
    --primary-dark: #5639b0;
    --accent: #d9b35a;
    --border: #e6e1f0;
    --danger: #c0392b;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(60, 40, 120, 0.08);
    --font-ar: 'Tajawal', system-ui, sans-serif;
    --font-en: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-en);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body.locale-ar { font-family: var(--font-ar); }

.container {
    width: min(960px, 92%);
    margin-inline: auto;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Header --- */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--ink);
}
.brand-mark { color: var(--accent); font-size: 1.4rem; }
.site-nav { display: flex; align-items: center; gap: 18px; }
.lang-switch {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 0.9rem;
}

/* --- Hero --- */
.hero { padding: 48px 0 16px; text-align: center; }
.hero-title { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 8px; }
.hero-subtitle { color: var(--muted); margin: 0; }

/* --- Cards & forms --- */
.site-main { padding-bottom: 64px; }
.form-section { padding-top: 28px; }
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}
.chart-form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
label { font-weight: 500; font-size: 0.95rem; }

input[type="text"],
input[type="date"],
input[type="time"],
select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
    background: #fff;
    color: var(--ink);
}
input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(109, 78, 209, 0.15);
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--muted);
    margin-top: 6px;
}
.checkbox input { width: auto; }

.field-hint { color: var(--muted); font-size: 0.85rem; }
.field-error { color: var(--danger); font-size: 0.82rem; min-height: 1em; }

/* --- Autocomplete --- */
.autocomplete { position: relative; }
.suggestions {
    list-style: none;
    margin: 4px 0 0;
    padding: 6px;
    position: absolute;
    inset-inline: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    z-index: 30;
    max-height: 260px;
    overflow-y: auto;
}
.suggestions li {
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.92rem;
}
.suggestions li:hover,
.suggestions li.active { background: var(--bg); }
.suggestions li .sug-tz { color: var(--muted); font-size: 0.8rem; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 20px;
    font: inherit;
    font-weight: 600;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    transition: transform .05s ease, background .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-block { width: 100%; }

/* --- Tables / results --- */
.data-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.data-table th, .data-table td {
    text-align: start;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
.data-table th { color: var(--muted); font-weight: 600; width: 40%; }
.muted { color: var(--muted); }
.error-card { border-color: var(--danger); }
.error-card ul { margin: 0 0 12px; padding-inline-start: 18px; color: var(--danger); }
.results-placeholder { padding-top: 28px; }
.results { padding-top: 28px; display: flex; flex-direction: column; gap: 20px; }
.results h2 { margin-top: 0; font-size: 1.15rem; }
.big-three {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 16px;
}
.bt-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}
.bt-label { display: block; color: var(--muted); font-size: 0.85rem; margin-bottom: 4px; }
.bt-value { font-weight: 700; }
.planets-table td:first-child { font-weight: 600; }
@media (max-width: 560px) { .big-three { grid-template-columns: 1fr; } }

/* --- Natal wheel --- */
.wheel-figure { margin: 0; }
.wheel-canvas {
    width: 100%;
    max-width: 640px;
    margin-inline: auto;
}
.wheel-canvas .natal-wheel {
    width: 100%;
    height: auto;
    display: block;
}
.wheel-toolbar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.btn-sm { padding: 7px 14px; font-size: 0.88rem; }
@media (max-width: 480px) {
    .wheel-toolbar .btn-sm { flex: 1 1 auto; }
}

/* --- AI report --- */
.ai-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ai-head h2 { margin: 0; }
.ai-actions { display: flex; gap: 8px; }
.ai-status { color: var(--muted); font-size: 0.9rem; margin: 10px 0; }
.ai-summary, .ai-full { margin-top: 16px; }
.ai-summary h3, .ai-full h3 { font-size: 1.05rem; color: var(--primary-dark); }
.ai-section { margin-bottom: 18px; }
.ai-section h3 { font-size: 1.02rem; color: var(--primary-dark); margin-bottom: 4px; }
.ai-summary-body p, .ai-full-body p { line-height: 1.85; margin: 0 0 10px; }
.ai-disclaimer { margin-top: 18px; font-size: 0.82rem; border-top: 1px solid var(--border); padding-top: 12px; }

.results-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 4px; }

.btn-lg { padding: 14px 30px; font-size: 1.05rem; font-weight: 700; }

/* --- Teaser intro --- */
.teaser-card h2 { font-size: 1.15rem; color: var(--primary-dark); margin-bottom: 8px; }
.teaser-intro { line-height: 1.9; margin: 0; }

/* --- Paywall (locked full report) --- */
.paywall-card { position: relative; }
.paywall-head { text-align: center; margin-bottom: 18px; }
.paywall-head h2 { font-size: 1.25rem; color: var(--primary-dark); margin-bottom: 4px; }

.locked-sections {
    display: grid;
    gap: 12px;
    position: relative;
}
.locked-section {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    background: linear-gradient(180deg, #fff, #faf8ff);
}
.locked-section-head {
    display: flex;
    align-items: center;
    gap: 10px;
}
.locked-index {
    flex: 0 0 auto;
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
}
.locked-section-head h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--ink);
    flex: 1 1 auto;
}
.lock-badge { font-size: 0.95rem; opacity: 0.7; }
.locked-preview {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.8;
    /* The real value stays hidden: the preview is intentionally unreadable. */
    filter: blur(4.5px);
    user-select: none;
    pointer-events: none;
}

.paywall-cta {
    margin-top: 22px;
    padding: 22px;
    text-align: center;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(109, 78, 209, 0.10), rgba(217, 179, 90, 0.12));
    border: 1px solid var(--border);
}
.paywall-pitch { font-size: 1.05rem; font-weight: 600; margin: 0 0 14px; }
.paywall-pdf-note { margin: 12px 0 0; font-size: 0.85rem; }

/* --- Subscribe / pricing page --- */
.subscribe-hero { text-align: center; }
.subscribe-hero h1 { margin-bottom: 6px; }
.plan-card { max-width: 520px; margin-inline: auto; }
.plan-highlight { border: 2px solid var(--primary); box-shadow: var(--shadow); }
.plan-head { text-align: center; margin-bottom: 16px; }
.plan-head h2 { color: var(--primary-dark); margin-bottom: 8px; }
.plan-price { display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.plan-amount { font-size: 2rem; font-weight: 700; }
.plan-period { color: var(--muted); }
.plan-benefits { list-style: none; padding: 0; margin: 0 0 18px; }
.plan-benefits li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.plan-benefits li:last-child { border-bottom: 0; }
.plan-benefits .check { color: var(--primary); font-weight: 700; }
.plan-card .btn-lg { width: 100%; }
.sub-soon-note { text-align: center; margin: 12px 0 0; font-size: 0.85rem; }
.subscribe-back { text-align: center; margin-top: 18px; }

/* --- Auth pages --- */
.auth-page { padding-top: 36px; }
.auth-card { max-width: 440px; margin-inline: auto; }
.auth-card h1 { margin-bottom: 14px; }
.auth-alt { margin: 12px 0 0; font-size: 0.9rem; }
.success-note {
    background: rgba(73, 170, 110, 0.12);
    border: 1px solid rgba(73, 170, 110, 0.4);
    color: #2f7d4f;
    padding: 12px 14px;
    border-radius: var(--radius);
    margin: 0 0 12px;
}

/* --- Account / charts --- */
.account-meta p { margin: 4px 0; }
.sub-active { color: #2f7d4f; font-weight: 600; }
.status-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--border);
    color: var(--ink);
}
.status-under_review { background: #fff3cd; color: #8a6d1b; }
.status-approved { background: rgba(73, 170, 110, 0.18); color: #2f7d4f; }
.status-rejected { background: rgba(192, 57, 43, 0.14); color: var(--danger); }
.status-awaiting_payment { background: #e7e1f7; color: var(--primary-dark); }

/* --- Plans grid --- */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.plans-grid .plan-card { max-width: none; margin: 0; }

/* --- Payment / bank transfer --- */
.bank-table th { text-align: start; width: 42%; color: var(--muted); font-weight: 600; }
.ref-code { font-size: 1.05rem; font-weight: 700; color: var(--primary-dark); }
.payment-ref-note { margin-top: 10px; font-size: 0.85rem; }
.qr-slot { margin-top: 16px; display: flex; justify-content: center; }
.qr-img { width: 180px; height: 180px; object-fit: contain; }
.qr-placeholder {
    width: 180px; height: 180px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 6px;
    color: var(--muted);
}
.qr-placeholder span { font-size: 1.4rem; font-weight: 700; letter-spacing: 2px; }
.inline-actions { display: inline-flex; gap: 6px; }
.admin-filters { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* --- Footer --- */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 20px 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .field-row { grid-template-columns: 1fr; }
    .hero { padding: 32px 0 8px; }
    .card { padding: 20px; }
}
