/* ============================================================
   reftrack — Partner Dashboard Stylesheet
   Design: Clean, AdSense-inspired dark sidebar layout
   ============================================================ */

/* ----- Reset & Base ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:          #f4f6fa;
    --bg-card:     #ffffff;
    --sidebar-bg:  #1a1f2e;
    --sidebar-w:   240px;
    --header-h:    60px;
    --white:       #ffffff;
    --text:        #2d3748;
    --text-muted:  #718096;
    --border:      #e2e8f0;
    --primary:     #4f6ef7;
    --primary-dk:  #3a56d4;
    --success:     #38a169;
    --danger:      #e53e3e;
    --warning:     #d69e2e;
    --card-radius: 12px;
    --shadow:      0 2px 12px rgba(0,0,0,.08);
    --font:        'Segoe UI', system-ui, -apple-system, sans-serif;
}

html, body { height: 100%; }

body {
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
    background: #edf2f7;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
}

/* ----- Auth Layout ----------------------------------------- */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }

.auth-wrapper {
    width: 100%;
    padding: 24px 16px;
    display: flex;
    justify-content: center;
}

.auth-card {
    background: var(--white);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    padding: 40px;
    width: 100%;
    max-width: 440px;
}

.auth-card--wide { max-width: 680px; }

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    margin: 8px 0 4px;
}

.auth-logo p { color: var(--text-muted); font-size: 14px; }

.brand-icon {
    display: inline-block;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    font-size: 20px;
    line-height: 48px;
    text-align: center;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ----- Forms ----------------------------------------------- */
.form-group { margin-bottom: 18px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font);
    color: var(--text);
    background: var(--white);
    transition: border-color .2s;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,110,247,.15);
}

small { display: block; margin-top: 4px; color: var(--text-muted); font-size: 12px; }

.field-error {
    display: none;
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
}

.input-with-toggle { position: relative; }
.input-with-toggle input { padding-right: 42px; }
.toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-muted);
    padding: 0;
}

/* ----- Buttons --------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, opacity .2s;
    text-decoration: none;
}

.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled)  { background: var(--primary-dk); text-decoration: none; }

.btn-success  { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled)  { background: #2f855a; text-decoration: none; }

.btn-danger   { background: var(--danger);  color: #fff; }
.btn-danger:hover:not(:disabled)   { background: #c53030; text-decoration: none; }

.btn-outline  { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover:not(:disabled)  { background: #eef1fe; text-decoration: none; }

.btn-full     { width: 100%; margin-top: 8px; }

.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ----- Alerts ---------------------------------------------- */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    line-height: 1.5;
}

.alert-success { background: #f0fff4; color: #276749; border: 1px solid #c6f6d5; }
.alert-error   { background: #fff5f5; color: #9b2c2c; border: 1px solid #fed7d7; }
.alert-warning { background: #fffbeb; color: #744210; border: 1px solid #fefcbf; }
.alert-info    { background: #ebf8ff; color: #2c5282; border: 1px solid #bee3f8; }

/* ----- Dashboard Layout ------------------------------------ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    color: #a0aec0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform .3s;
}

.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-brand .brand-name {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .3px;
}

.sidebar-brand .brand-icon {
    width: 34px;
    height: 34px;
    font-size: 14px;
    line-height: 34px;
    border-radius: 8px;
}

.nav-links {
    list-style: none;
    padding: 16px 0;
    flex: 1;
    overflow-y: auto;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    color: #a0aec0;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s, color .15s;
    text-decoration: none;
}

.nav-links li a:hover,
.nav-links li.active a {
    background: rgba(255,255,255,.07);
    color: #fff;
}

.nav-links li.active a {
    border-left: 3px solid var(--primary);
    padding-left: 17px;
}

.nav-icon { font-style: normal; width: 18px; text-align: center; }

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,.06);
    font-size: 13px;
}

.ref-pill {
    display: block;
    background: rgba(255,255,255,.08);
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 10px;
    color: #a0aec0;
}

.ref-pill strong { color: #fff; }

.logout-link { color: #a0aec0; font-size: 12px; }
.logout-link:hover { color: var(--danger); text-decoration: none; }

/* Main content area */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: calc(var(--header-h) + 32px) 32px 32px;
    min-width: 0;
}

/* Page header */
.page-header { margin-bottom: 28px; }
.page-header h2 { font-size: 22px; font-weight: 700; color: var(--text); }
.page-header p  { color: var(--text-muted); margin-top: 4px; font-size: 14px; }

/* ----- Stat Cards ------------------------------------------ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--card-radius);
    padding: 22px 20px;
    box-shadow: var(--shadow);
}

.stat-card__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-card__value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.stat-card__sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.stat-card--primary .stat-card__value { color: var(--primary); }
.stat-card--success .stat-card__value { color: var(--success); }

/* ----- Range Tabs ------------------------------------------ */
.range-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.range-tab {
    padding: 6px 16px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: var(--white);
    color: var(--text-muted);
    transition: all .15s;
}

.range-tab.active,
.range-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #eef1fe;
}

/* ----- Table ----------------------------------------------- */
.table-card {
    background: var(--white);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 24px;
}

.table-card__header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.table-card__title { font-size: 16px; font-weight: 700; }

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: 11px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 13px 16px;
    font-size: 13px;
    border-bottom: 1px solid #f0f4f8;
    color: var(--text);
}

tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbff; }

.td-right { text-align: right; }

/* ----- Badge ----------------------------------------------- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.badge-success  { background: #f0fff4; color: var(--success); }
.badge-warning  { background: #fffbeb; color: var(--warning); }
.badge-danger   { background: #fff5f5; color: var(--danger); }
.badge-info     { background: #ebf8ff; color: #2b6cb0; }
.badge-muted    { background: #f7fafc; color: var(--text-muted); }

/* ----- Copy Input ------------------------------------------ */
.copy-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.copy-group input[type="text"] {
    flex: 1;
    background: #f8fafc;
    border: 1.5px solid var(--border);
    font-family: monospace;
    font-size: 13px;
}

/* ----- Date Range Picker ----------------------------------- */
.date-range-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.date-range-form .form-group { margin-bottom: 0; }
.date-range-form label { font-size: 12px; }

/* ----- Loading Spinner ------------------------------------- */
.loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ----- Empty State ----------------------------------------- */
.empty-state {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state p { margin-top: 8px; font-size: 13px; }

/* ----- Top Header ------------------------------------------ */
.top-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: var(--header-h);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 99;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.top-header__left { flex: 1; }

.top-header__right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    transition: background .15s, color .15s;
    text-decoration: none;
    position: relative;
}
.header-btn:hover { background: var(--bg); color: var(--text); text-decoration: none; }

.menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
}

.menu-toggle span {
    width: 16px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
}

.lang-btn .lang-flag { font-size: 19px; line-height: 1; }
.lang-btn .lang-label { font-size: 12px; font-weight: 600; }

.notif-btn { position: relative; }
.notif-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    min-width: 16px;
    height: 16px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 8px;
    line-height: 16px;
    text-align: center;
    padding: 0 3px;
}

.user-avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: .5px;
    transition: opacity .15s;
    margin-left: 4px;
}
.user-avatar-btn:hover { opacity: .85; }

.user-menu { position: relative; }

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 248px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.13);
    display: none;
    z-index: 300;
    overflow: hidden;
}
.user-dropdown.open { display: block; }

.user-dropdown__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.user-dropdown__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.user-dropdown__name  { font-size: 14px; font-weight: 600; color: var(--text); }
.user-dropdown__email { font-size: 11px; color: var(--text-muted); margin-top: 2px; word-break: break-all; }

.user-dropdown__body { padding: 6px; }

.user-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
    transition: background .12s;
}
.user-dropdown__item:hover { background: var(--bg); text-decoration: none; }
.user-dropdown__item--danger       { color: var(--danger); }
.user-dropdown__item--danger:hover { background: #fff5f5; }
.user-dropdown__item svg           { flex-shrink: 0; opacity: .7; }

.user-dropdown__divider { height: 1px; background: var(--border); margin: 4px 6px; }

/* ----- Notification Panel ---------------------------------- */
.notif-wrapper { position: relative; }

.notif-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.13);
    display: none;
    flex-direction: column;
    z-index: 300;
    overflow: hidden;
    max-height: 480px;
}
.notif-panel.open { display: flex; }

.notif-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
}
.notif-panel__title { font-size: 14px; font-weight: 600; color: var(--text); }
.notif-mark-all {
    font-size: 12px;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: inherit;
}
.notif-mark-all:hover { background: rgba(79,110,247,.1); }

.notif-panel__body { overflow-y: auto; flex: 1; }

.notif-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 13px;
}

.notif-item {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background .12s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg); }
.notif-item--unread { background: #f0f4ff; }
.notif-item--unread:hover { background: #e8eeff; }
.notif-item--clickable { cursor: pointer; }

.notif-item__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    margin-top: 5px;
}
.notif-item--read .notif-item__dot { background: #cbd5e0; }

.notif-item__content { flex: 1; min-width: 0; }
.notif-item__title { font-size: 13px; font-weight: 600; color: var(--text); }
.notif-item__body  { font-size: 12px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-item__link-label { font-size: 11px; color: var(--primary); margin-top: 4px; font-weight: 500; }
.notif-item__time  { font-size: 11px; color: var(--text-muted); flex-shrink: 0; white-space: nowrap; margin-top: 2px; }

/* RTL: flip panel to the left */
[dir="rtl"] .notif-panel {
    right: auto;
    left: 0;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(9, 17, 31, .5);
    display: none;
    z-index: 96;
}

.sidebar-overlay.open {
    display: block;
}

/* ----- Responsive ------------------------------------------ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: calc(var(--header-h) + 16px) 16px 16px;
    }

    .top-header {
        left: 0;
        padding: 0 12px;
    }

    .stats-grid { grid-template-columns: 1fr 1fr; }

    .menu-toggle {
        display: inline-flex;
    }

    .notif-panel {
        width: min(360px, calc(100vw - 24px));
        right: -6px;
    }

    .table-card {
        overflow-x: auto;
    }

    .table-card__header,
    .table-card table {
        min-width: 720px;
    }
}

/* ----- Admin Panel Specific -------------------------------- */
.admin-layout .sidebar { background: #12161f; }

/* ============================================================
   RTL Support (Arabic and other right-to-left languages)
   Uses [dir="rtl"] attribute set on <html> by Lang::dir()
   ============================================================ */

/* Font: Cairo for Arabic — applied to ALL elements including form controls */
[dir="rtl"] body,
[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] select,
[dir="rtl"] button,
[dir="rtl"] .btn {
    font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
}

/* Sidebar: flip to right side */
[dir="rtl"] .sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--border);
}

/* Main content: flip margin */
[dir="rtl"] .main-content {
    margin-left: 0;
    margin-right: var(--sidebar-w);
}

/* Header: flip to right side in RTL */
[dir="rtl"] .top-header {
    left: 0;
    right: var(--sidebar-w);
}

@media (max-width: 768px) {
    [dir="rtl"] .sidebar {
        transform: translateX(100%);
    }

    [dir="rtl"] .sidebar.open {
        transform: translateX(0);
    }
}

/* User dropdown: open to the left in RTL */
[dir="rtl"] .user-dropdown {
    right: auto;
    left: 0;
}

/* Avatar margin flip */
[dir="rtl"] .user-avatar-btn {
    margin-left: 0;
    margin-right: 4px;
}

/* Table right-aligned columns: flip to left */
[dir="rtl"] .td-right {
    text-align: left;
}

/* Table headers that mirror td-right */
[dir="rtl"] th.td-right {
    text-align: left;
}

/* Page header text alignment */
[dir="rtl"] .page-header,
[dir="rtl"] .table-card__header {
    text-align: right;
}

/* Form labels */
[dir="rtl"] label,
[dir="rtl"] .form-group small,
[dir="rtl"] .field-error, {
    text-align: right;
    display: block;
}

/* Auth card */
[dir="rtl"] .auth-card,
[dir="rtl"] th,
[dir="rtl"] td {
    text-align: right;
}

/* Stat cards */
[dir="rtl"] .stat-card__label,
[dir="rtl"] .stat-card__value,
[dir="rtl"] .stat-card__sub {
    text-align: right;
}

/* Nav links: RTL spacing */
[dir="rtl"] .nav-icon {
    margin-right: 0;
    margin-left: 8px;
}

/* Badges / table cells */
[dir="rtl"] td {
    text-align: right;
}
[dir="rtl"] td.td-right {
    text-align: left;
}

/* Lang switch link */
.lang-switch {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,.5);
    text-decoration: none;
    padding: 4px 0;
    transition: color .2s;
}
.lang-switch:hover {
    color: #fff;
}

/* ============================================================
   Landing Page
   ============================================================ */
.landing-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 0 0, #d7ecff 0, rgba(215, 236, 255, 0) 42%),
        radial-gradient(circle at 100% 100%, #ffe7c2 0, rgba(255, 231, 194, 0) 40%),
        #f5f8fd;
}

.landing-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    border-bottom: 1px solid #dbe6f4;
    background: rgba(245, 248, 253, .9);
    backdrop-filter: blur(8px);
}

.landing-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 800;
    color: #10213f;
    text-decoration: none;
}

.landing-brand .brand-icon {
    width: 38px;
    height: 38px;
    line-height: 38px;
}

.landing-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.landing-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    color: #19325d;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid transparent;
}

.landing-nav a:hover {
    background: #eaf1fb;
    text-decoration: none;
}

.landing-nav-cta {
    background: #1f3e73;
    color: #fff !important;
}

.landing-main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 36px 24px 48px;
}

.hero {
    background:
        linear-gradient(155deg, rgba(255,255,255,.95), rgba(255,255,255,.88)),
        linear-gradient(120deg, #dfeeff, #fff1dd);
    border: 1px solid #dce8f5;
    border-radius: 24px;
    padding: 38px 34px;
    box-shadow: 0 18px 40px rgba(16, 33, 63, .09);
}

.hero-kicker {
    display: inline-block;
    background: #e8f2ff;
    color: #184b8a;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .2px;
}

.hero h1 {
    margin-top: 14px;
    font-size: clamp(28px, 4.2vw, 48px);
    line-height: 1.08;
    color: #11274a;
    max-width: 900px;
}

.hero-sub {
    margin-top: 14px;
    max-width: 720px;
    color: #3f536f;
    font-size: 16px;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.hero-metrics {
    margin-top: 26px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.hero-metrics div {
    background: rgba(255,255,255,.85);
    border: 1px solid #d7e6f7;
    border-radius: 12px;
    padding: 12px 14px;
}

.hero-metrics strong {
    display: block;
    color: #16345f;
    font-size: 18px;
}

.hero-metrics span {
    color: #51698b;
    font-size: 12px;
}

.landing-section {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.feature-card {
    background: #fff;
    border: 1px solid #dae6f4;
    border-radius: 16px;
    padding: 18px;
}

.feature-card h3 {
    color: #152c51;
    font-size: 19px;
    margin-bottom: 8px;
}

.feature-card p {
    color: #576e8f;
    line-height: 1.6;
}

.landing-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid #c9d8ec;
    border-radius: 10px;
    background: #fff;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.landing-menu-toggle span {
    width: 18px;
    height: 2px;
    background: #1a355f;
}

.lang-modal-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(6, 14, 28, .5);
    z-index: 50;
    padding: 16px;
}

.lang-modal-backdrop.open {
    display: flex;
}

.lang-modal {
    width: min(520px, 100%);
    background: #fff;
    border-radius: 16px;
    border: 1px solid #d8e5f5;
    padding: 24px;
    box-shadow: 0 20px 36px rgba(7, 18, 35, .26);
}

.lang-modal h2 {
    font-size: 24px;
    color: #10274b;
}

.lang-modal p {
    margin-top: 8px;
    color: #4c6181;
}

.lang-options {
    margin-top: 18px;
    display: grid;
    gap: 10px;
}

.lang-choice {
    width: 100%;
    text-align: left;
    border: 1px solid #ccdcf0;
    background: #f7fbff;
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
}

.lang-choice span {
    display: block;
    color: #163765;
    font-size: 17px;
    font-weight: 700;
}

.lang-choice small {
    margin: 4px 0 0;
    color: #5e7597;
}

.lang-choice:hover {
    border-color: #8fb4e6;
    background: #eef6ff;
}

.lang-skip {
    margin-top: 12px;
    border: 0;
    background: transparent;
    color: #3d5480;
    cursor: pointer;
    font-size: 13px;
}

.lang-skip:hover {
    color: #1b3867;
}

[dir="rtl"] .lang-choice {
    text-align: right;
}

@media (max-width: 900px) {
    .landing-main {
        padding: 24px 14px 28px;
    }

    .hero {
        padding: 24px 18px;
    }

    .landing-section {
        grid-template-columns: 1fr;
    }

    .hero-metrics {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .landing-header {
        padding: 12px 14px;
    }

    .landing-menu-toggle {
        display: inline-flex;
    }

    .landing-nav {
        position: absolute;
        top: 64px;
        left: 12px;
        right: 12px;
        display: none;
        flex-direction: column;
        background: #fff;
        border: 1px solid #d5e2f3;
        border-radius: 12px;
        padding: 10px;
        box-shadow: 0 12px 24px rgba(14, 27, 48, .14);
    }

    .landing-nav.open {
        display: flex;
    }

    .landing-nav a {
        width: 100%;
        justify-content: center;
    }
}
