:root {
    --bg: #f4f7fb;
    --card: #ffffff;
    --text: #1a2332;
    --muted: #64748b;
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --border: #e2e8f0;
    --error: #dc2626;
    --success: #16a34a;
    --warn: #d97706;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Vazirmatn", Tahoma, sans-serif;
    background: linear-gradient(180deg, #e0f2fe 0%, var(--bg) 240px);
    color: var(--text);
    line-height: 1.6;
}

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

.container {
    width: min(960px, calc(100% - 2rem));
    margin: 0 auto;
}

.site-header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

.brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
}

.main-nav {
    display: flex;
    gap: 1rem;
}

.main-nav a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
}

.main-nav a.active,
.main-nav a:hover {
    color: var(--primary-dark);
}

.user-box { color: var(--muted); font-size: 0.95rem; }

.site-main { padding: 1.5rem 0 3rem; }

.site-footer {
    border-top: 1px solid var(--border);
    background: #fff;
    padding: 1.25rem 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.footer-inner p { margin: 0.25rem 0; }

.hero-card {
    margin-bottom: 1rem;
    padding: 1.25rem 0;
}

.hero-card h1 {
    margin: 0 0 0.35rem;
    font-size: 1.6rem;
}

.hero-card.compact h1 { font-size: 1.35rem; }

.hero-card p { margin: 0; color: var(--muted); }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.search-form .trip-type-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.chip-radio {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    background: #f8fafc;
}

.chip-radio:has(input:checked) {
    border-color: var(--primary);
    background: #e0f2fe;
    color: var(--primary-dark);
}

.chip-radio input { accent-color: var(--primary); }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.passenger-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.field label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.field input,
.field select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    font: inherit;
    background: #fff;
}

.field input:focus,
.field select:focus {
    outline: 2px solid rgba(14, 165, 233, 0.25);
    border-color: var(--primary);
}

.return-date-field.is-hidden { display: none; }

.persian-date-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.persian-date-row .date-select {
    min-width: 0;
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.65rem 0.5rem;
    font: inherit;
    background: #fff;
}

.persian-date-row .date-year { flex: 0 0 88px; }
.persian-date-row .date-month { flex: 1 1 120px; }
.persian-date-row .date-day { flex: 0 0 72px; }

@media (max-width: 720px) {
    .persian-date-row {
        flex-wrap: wrap;
    }
    .persian-date-row .date-year,
    .persian-date-row .date-month,
    .persian-date-row .date-day {
        flex: 1 1 30%;
    }
}

.autocomplete-wrap { position: relative; }

.suggestions {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    max-height: 220px;
    overflow: auto;
    display: none;
    z-index: 30;
}

.suggestions.open { display: block; }

.suggestion-item {
    padding: 0.65rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}

.suggestion-item:hover,
.suggestion-item.active { background: #f0f9ff; }

.suggestion-item small { color: var(--muted); display: block; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: none;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.btn-block { width: 100%; margin-top: 0.5rem; }
.btn-sm { padding: 0.45rem 0.75rem; font-size: 0.9rem; }

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }

.btn-secondary {
    background: #f1f5f9;
    color: var(--text);
}

.alert {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.alert-error { background: #fef2f2; color: var(--error); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.alert-warn { background: #fffbeb; color: var(--warn); border: 1px solid #fde68a; }

.breadcrumb {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    color: var(--muted);
    margin-bottom: 1rem;
    font-size: 0.92rem;
}

.summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    align-items: center;
    justify-content: space-between;
}

.muted { color: var(--muted); }
.small { font-size: 0.88rem; }

.offer-list { display: grid; gap: 0.85rem; }

.offer-card {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.offer-airline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.offer-route { margin-top: 0.25rem; }

.offer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.offer-side { text-align: left; min-width: 140px; }
.offer-price { font-size: 1.15rem; font-weight: 700; color: var(--primary-dark); }

.leg-badge {
    display: inline-block;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.75rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
}

.leg-badge.leg-return { background: #fef3c7; color: #b45309; }

.leg-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border);
}

.leg-summary:last-of-type { border-bottom: none; }

.total-line {
    margin-top: 0.75rem;
    font-size: 1.05rem;
}

.passenger-block {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.passenger-block legend {
    padding: 0 0.35rem;
    font-weight: 600;
}

.empty-state { text-align: center; }
.empty-state h2 { margin-top: 0; }

.booking-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-muted { background: #f1f5f9; color: #475569; }
.badge-info { background: #e0f2fe; color: #0369a1; }

.booking-list { display: grid; gap: 0.85rem; }

.booking-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.booking-row h2 {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
}

.booking-row-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}

.payment-total {
    font-size: 1.2rem;
    margin: 1rem 0;
    padding: 0.85rem;
    background: #f8fafc;
    border-radius: 10px;
}

.passenger-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.passenger-list li {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.voucher-json {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 10px;
    overflow: auto;
    font-size: 0.82rem;
    direction: ltr;
    text-align: left;
}

@media (max-width: 720px) {
    .form-grid,
    .passenger-row {
        grid-template-columns: 1fr;
    }

    .offer-side,
    .booking-row-side {
        width: 100%;
        text-align: right;
        align-items: stretch;
    }
}
