/* Component classes on top of Tailwind's utilities.
   Colours come from the MPCHS logo: green #00A859 and red #C52F33.
   Buttons, links and headings use darker greens (#007F43 / #00733D) so text stays readable. */
:root {
    --green: #00A859;        /* logo green: accents, borders, bars */
    --green-600: #007F43;    /* buttons, links (white text 5.1:1) */
    --green-700: #00733D;    /* headings, hover */
    --green-900: #0B3B24;
    --green-50: #EEF9F3;
    --green-100: #D4F1E1;
    --red: #C52F33;          /* logo red: call-to-action, danger */
    --red-600: #A8262A;
}

body { background: #F6FAF7; }

/* --- Navigation --------------------------------------------------------- */
.nav-link { display: block; padding: .5rem .75rem; border-radius: .5rem; color: #334155; font-weight: 500; }
.nav-link:hover { color: var(--green-700); background: var(--green-50); }
.nav-link.active { color: var(--green-700); background: var(--green-100); }

/* --- Forms -------------------------------------------------------------- */
.form-label { display: block; margin-bottom: .25rem; font-size: .875rem; font-weight: 500; color: #334155; }
.form-input {
    width: 100%; padding: .625rem .75rem; border: 1px solid #cbd5e1; border-radius: .5rem;
    background: #fff; transition: border-color .15s, box-shadow .15s;
}
.form-input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(0, 168, 89, .2); }
.form-error { margin-top: .25rem; font-size: .8125rem; color: #dc2626; min-height: 0; }
.form-error:empty { display: none; }
.file-input { padding: .45rem .5rem; }
.file-input::file-selector-button { margin-inline-end: .75rem; padding: .35rem .75rem; border: 0; border-radius: .375rem; background: var(--green-100); color: var(--green-700); font-weight: 500; cursor: pointer; }
textarea.form-input { resize: vertical; }

/* --- Buttons ------------------------------------------------------------ */
.btn-primary, .btn-secondary, .btn-danger, .btn-accent, .btn-outline-light, .btn-whatsapp {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .65rem 1.25rem; border-radius: .5rem; font-weight: 600; transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn-primary { background: var(--green-600); color: #fff; }
.btn-primary:hover { background: var(--green-700); }
.btn-secondary { background: #fff; color: #334155; border: 1px solid #cbd5e1; }
.btn-secondary:hover { background: var(--green-50); border-color: var(--green); color: var(--green-700); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: var(--red-600); }
/* Red call-to-action (e.g. "Order tanker") */
.btn-accent { background: var(--red); color: #fff; box-shadow: 0 2px 8px rgba(197, 47, 51, .25); }
.btn-accent:hover { background: var(--red-600); }
/* Outline button on the green hero */
.btn-outline-light { color: #fff; border: 1px solid rgba(255, 255, 255, .5); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .12); }
/* "Verify on WhatsApp": WhatsApp's dark green, so white text stays readable */
.btn-whatsapp { background: #0A7C66; color: #fff; }
.btn-whatsapp:hover { background: #075E54; }
.btn-primary:disabled, .btn-danger:disabled, .btn-accent:disabled, .btn-whatsapp:disabled { opacity: .6; cursor: not-allowed; }
.spinner { width: 1rem; height: 1rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 9999px;
           display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
:is(.btn-primary, .btn-secondary, .btn-danger, .btn-accent, .btn-outline-light, .nav-link, .link):focus-visible {
    outline: 3px solid rgba(0, 168, 89, .45); outline-offset: 2px;
}

/* --- Cards, tabs, tables ------------------------------------------------ */
.module-card { display: block; background: #fff; border-radius: .75rem; padding: 1.5rem; border: 1px solid #e2e8f0; border-top: 4px solid var(--green); transition: box-shadow .15s, transform .15s; }
.module-card:hover { box-shadow: 0 8px 24px rgba(11, 59, 36, .12); transform: translateY(-2px); }

.tab { padding: .6rem 1rem; font-weight: 500; color: #64748b; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--green-700); border-color: var(--green); }

.data-table { width: 100%; font-size: .875rem; }
.data-table th { text-align: start; font-weight: 600; color: #475569; background: #f8fafc; padding: .6rem 1rem; border-bottom: 1px solid #e2e8f0; }
.data-table td { padding: .6rem 1rem; border-bottom: 1px solid #f1f5f9; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #fbfdfc; }
.data-table.compact th, .data-table.compact td { padding: .5rem .75rem; }

/* --- Badges, chips, notices -------------------------------------------- */
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 9999px; font-size: .75rem; font-weight: 500; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-slate { background: #f1f5f9; color: #64748b; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-red { background: #fee2e2; color: #991b1b; }

.chip { padding: .35rem .9rem; border-radius: 9999px; font-size: .875rem; font-weight: 500; background: #fff; color: #475569; border: 1px solid #e2e8f0; }
.chip:hover { border-color: var(--green); color: var(--green-700); }
.chip.active { background: var(--green-700); color: #fff; border-color: var(--green-700); }

.notice { padding: .75rem 1rem; border-radius: .5rem; margin-bottom: 1rem; font-size: .9rem; background: var(--green-50); color: var(--green-900); border-inline-start: 4px solid var(--green); }
.notice-success { background: #ecfdf5; color: #065f46; border-inline-start-color: var(--green); }
.notice-error { background: #fef2f2; color: #991b1b; border-inline-start-color: var(--red); }
.notice-warning { background: #fffbeb; color: #92400e; border-inline-start-color: #f59e0b; }
.notice-info { background: #eff6ff; color: #1e3a8a; border-inline-start-color: #3b82f6; }

.link { color: var(--green-600); font-weight: 500; }
.link:hover { color: var(--green-700); text-decoration: underline; }
.link-danger { color: var(--red); }
.link-danger:hover { color: var(--red-600); }

.tanker-pill { font-family: ui-monospace, monospace; font-size: .7rem; padding: .15rem .45rem; border-radius: .375rem; background: #f1f5f9; color: #334155; }
.tanker-pill b { color: var(--green-700); }
.tanker-pill.full { background: #fee2e2; color: #991b1b; }
.tanker-pill.full b { color: #991b1b; }

/* --- Admin panel -------------------------------------------------------- */
.admin-link { display: flex; align-items: flex-start; gap: .75rem; padding: .75rem 1rem; border: 1px solid #e2e8f0; border-radius: .5rem; font-size: 1.25rem; transition: border-color .15s, background .15s; }
.admin-link:hover { border-color: var(--green); background: var(--green-50); }
.admin-link b { display: block; font-size: .9rem; color: var(--green-700); }
.admin-link small { display: block; font-size: .75rem; color: #64748b; }
.perm-matrix .group-row th { background: var(--green-50); color: var(--green-700); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.perm-matrix input:disabled { opacity: .55; cursor: not-allowed; }
/* On/off switch: <label class="switch"><input type="checkbox"><span></span></label> */
.switch { position: relative; display: inline-block; flex-shrink: 0; width: 2.75rem; height: 1.5rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 9999px; background: #cbd5e1; transition: background .15s; pointer-events: none; }
.switch span::after { content: ''; position: absolute; top: .1875rem; left: .1875rem; width: 1.125rem; height: 1.125rem; border-radius: 9999px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + span { background: var(--green-600); }
.switch input:checked + span::after { transform: translateX(1.25rem); }
.switch input:focus-visible + span { outline: 3px solid rgba(0, 168, 89, .45); outline-offset: 2px; }
.switch input:disabled + span { opacity: .6; }

/* =======================================================================
   Motion & polish: entrance animations, lifting cards, springy buttons,
   animated dialogs, skeleton loaders, toasts. All motion is switched off
   for people who ask their system for reduced motion.
   ======================================================================= */
html { scroll-behavior: smooth; }
body {
    background:
        radial-gradient(1200px 500px at 100% -10%, rgba(0, 168, 89, .08), transparent 60%),
        radial-gradient(900px 400px at -10% 110%, rgba(0, 115, 61, .06), transparent 60%),
        #F6FAF7;
    background-attachment: fixed;
}

/* Header: frosted glass, a shadow once the page scrolls */
header.sticky { background: rgba(255, 255, 255, .85); backdrop-filter: saturate(1.4) blur(10px); transition: box-shadow .25s; }
header.sticky.scrolled { box-shadow: 0 6px 24px rgba(11, 59, 36, .08); }

/* Entrance: elements fade up in a gentle stagger (app.js adds .fade-up with a delay) */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp .5s cubic-bezier(.2, .8, .2, 1) both; }

/* Buttons: gradient, lift on hover, press down on click */
.btn-primary { background: linear-gradient(135deg, var(--green) 0%, var(--green-600) 55%, var(--green-700) 100%); box-shadow: 0 4px 14px rgba(0, 115, 61, .22); }
.btn-primary:hover { background: linear-gradient(135deg, #00b862 0%, var(--green-600) 50%, var(--green-900) 100%); }
.btn-accent { background: linear-gradient(135deg, #e0484c, var(--red)); }
:is(.btn-primary, .btn-secondary, .btn-danger, .btn-accent, .btn-whatsapp, .btn-outline-light) {
    transition: transform .15s cubic-bezier(.2, .8, .2, 1), box-shadow .2s, background .2s, border-color .2s, color .2s;
}
:is(.btn-primary, .btn-danger, .btn-accent, .btn-whatsapp):not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0, 115, 61, .25); }
:is(.btn-primary, .btn-secondary, .btn-danger, .btn-accent, .btn-whatsapp, .btn-outline-light, .chip):not(:disabled):active { transform: scale(.97); }
.btn-primary, .btn-secondary, .btn-danger, .btn-accent, .btn-whatsapp, .btn-outline-light { border-radius: .65rem; }

/* Fields: softer, glow on focus */
.form-input { border-radius: .65rem; border-color: #dbe4de; background: #fbfdfc; }
.form-input:hover { border-color: #b7d7c5; }
.form-input:focus { background: #fff; box-shadow: 0 0 0 4px rgba(0, 168, 89, .15); }

/* Cards: lift on hover */
.module-card { border-radius: 1rem; border-top-width: 0; box-shadow: 0 4px 16px rgba(11, 59, 36, .06); position: relative; overflow: hidden; }
.module-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--green), var(--green-700)); }
.module-card:hover { box-shadow: 0 16px 36px rgba(11, 59, 36, .14); transform: translateY(-4px); }
.module-card > span:first-child { display: inline-flex; width: 3.25rem; height: 3.25rem; align-items: center; justify-content: center;
    border-radius: 1rem; background: var(--green-50); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.module-card:hover > span:first-child { transform: scale(1.08) rotate(-4deg); }
.bg-white.rounded-xl { transition: box-shadow .2s; }

/* Badges with a status dot; chips animate */
.badge { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; padding: .15rem .6rem; }
.badge::before { content: ''; width: .4rem; height: .4rem; border-radius: 9999px; background: currentColor; opacity: .8; }
.chip { transition: all .2s; }
.chip.active { box-shadow: 0 4px 12px rgba(0, 115, 61, .25); }

/* Navigation: animated underline */
.nav-link { position: relative; transition: color .2s, background .2s; }
.nav-link.active::after { content: ''; position: absolute; left: .75rem; right: .75rem; bottom: .2rem; height: 2px; border-radius: 2px; background: var(--green); animation: fadeIn .3s both; }

/* Notices slide in */
.notice { border-radius: .75rem; animation: fadeUp .35s both; }

/* Dialogs open with a pop, the backdrop fades and blurs */
dialog[open] { animation: pop .25s cubic-bezier(.2, .8, .2, 1); border-radius: 1rem; }
dialog::backdrop { background: rgba(11, 30, 20, .45); backdrop-filter: blur(3px); animation: fadeIn .25s both; }

/* Tables: rows ease in when hovered */
.data-table tbody tr td { transition: background .15s; }
.data-table tbody tr:hover td { background: #f3faf6; }

/* Skeleton placeholders while something loads */
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }
.skeleton, .skeleton-list > div {
    background: linear-gradient(90deg, #edf2ef 0%, #f8fbf9 40%, #edf2ef 80%); background-size: 800px 100%;
    animation: shimmer 1.2s linear infinite; border-radius: .75rem;
}
.skeleton-list { display: grid; gap: .75rem; }
.skeleton-list > div { height: 4.5rem; }

/* Toasts (app.js: toast(text, type)) */
#toasts { position: fixed; z-index: 60; inset-inline-end: 1rem; bottom: 1rem; display: grid; gap: .5rem; max-width: min(24rem, calc(100vw - 2rem)); }
.toast { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; border-radius: .85rem; background: #fff; color: #1e293b;
    box-shadow: 0 12px 32px rgba(11, 30, 20, .18); border-inline-start: 4px solid var(--green); animation: pop .3s cubic-bezier(.2, .8, .2, 1) both; font-size: .9rem; }
.toast-error { border-inline-start-color: var(--red); }
.toast.leaving { animation: fadeIn .25s reverse both; }

/* Welcome banner on the dashboard */
.welcome-banner { background: linear-gradient(135deg, var(--green) 0%, var(--green-700) 55%, var(--green-900) 100%); color: #fff; border-radius: 1.25rem;
    padding: 1.5rem; box-shadow: 0 16px 40px rgba(0, 115, 61, .25); position: relative; overflow: hidden; }
.welcome-banner .avatar { width: 3.5rem; height: 3.5rem; border-radius: 9999px; background: rgba(255, 255, 255, .2); border: 2px solid rgba(255, 255, 255, .5);
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.25rem; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* 1-5 star rating in dialogs: grey until chosen */
.star-picker { display: flex; gap: .25rem; font-size: 2.25rem; line-height: 1; }
.star-picker label { cursor: pointer; }
.star-picker [data-star] { color: #cbd5e1; transition: color .15s, transform .15s; }
.star-picker [data-star].on { color: #f59e0b; }
.star-picker input:focus-visible + [data-star] { outline: 2px solid var(--green); border-radius: .25rem; }
.star-picker label:hover [data-star] { transform: scale(1.1); }

/* --- Urdu (right to left) ------------------------------------------------------------------------------------------------
   Latin letters and digits stay in Inter; Urdu letters fall through to Noto Nastaliq Urdu, which needs more line height.
   CNICs, phones, emails, numbers and codes stay left to right (class "ltr" or dir="ltr", <bdi> for values in text). */
html[lang="ur"] body { font-family: 'Inter', 'Noto Nastaliq Urdu', system-ui, sans-serif; line-height: 2; }
html[lang="ur"] :is(h1, h2, h3, h4) { line-height: 1.9; }
html[lang="ur"] :is(.form-input, .btn-primary, .btn-secondary, .btn-danger, .btn-accent, .badge, .nav-link) { line-height: 1.9; }
html[lang="ur"] .text-xs, html[lang="ur"] .text-sm { line-height: 2.1; }
.ltr, [dir="ltr"] { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] :is(input[type="email"], input[type="tel"], input[type="number"], input[name="cnic"], input[name="phone"], input[name="email"]) { direction: ltr; text-align: right; }
.lang-toggle { white-space: nowrap; }
.lang-toggle [lang="ur"], .lang-pill [lang="ur"] { font-family: 'Noto Nastaliq Urdu', system-ui, sans-serif; }
/* Header language control (brief §3): labelled and easy to find, never wider than the logo area needs */
.lang-pill { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .25rem .6rem; border: 1px solid #cbd5e1; border-radius: .75rem;
    background: #fff; color: #334155; white-space: nowrap; transition: border-color .2s, background .2s, color .2s; }
.lang-pill:hover { border-color: var(--green); background: var(--green-50); color: var(--green-700); }
.lang-pill:focus-visible { outline: 3px solid rgba(0, 168, 89, .45); outline-offset: 2px; }
.lang-pill-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.lang-pill-text small { font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #56637A; }
html[lang="ur"] .lang-pill-text small { text-transform: none; letter-spacing: 0; font-size: 11px; line-height: 1.5; }
.lang-pill-text b { font-size: .8rem; font-weight: 500; color: #64748b; }
.lang-pill-text b [lang="ur"] { line-height: 1.6; }
.lang-pill-text .lang-on { font-weight: 700; color: var(--green-700); }
@media (max-width: 380px) { .lang-pill { padding: .25rem .4rem; gap: .25rem; } .lang-pill svg { display: none; } }

/* Until app.js has checked the account: no visitor links for a signed-in user, no protected page shell */
html.has-token:not(.app-ready) [data-guest] { display: none !important; }
html:not(.app-ready) body[data-requires] main { visibility: hidden; }
/* Touch targets of at least 44px in the mobile menu */
@media (max-width: 767px) { #nav-menu .nav-link, #nav-menu .lang-toggle { display: flex; align-items: center; min-height: 44px; } }

/* --- Grouped navigation (header.php) --------------------------------------------------------------------------------
   Desktop: My services / Operations / Office open a panel; the account menu sits on the right.
   Phones: one list with labelled sections (the panels are always open). */
.nav-icon { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border-radius: .75rem; color: #334155; transition: background .2s, color .2s; }
.nav-icon:hover, .nav-icon.active { background: var(--green-50); color: var(--green-700); }
.nav-avatar { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: 2px; border-radius: 9999px; font-weight: 700; font-size: .85rem;
    color: #fff; background: linear-gradient(135deg, var(--green), var(--green-700)); box-shadow: 0 4px 12px rgba(0, 115, 61, .25); transition: transform .2s, box-shadow .2s; }
.nav-avatar:hover, .nav-account.open .nav-avatar { transform: translateY(-1px); box-shadow: 0 0 0 4px rgba(0, 168, 89, .18), 0 6px 16px rgba(0, 115, 61, .25); }
.nav-group { position: relative; }
.nav-group-btn { display: inline-flex; align-items: center; gap: .3rem; width: 100%; }
.nav-group-btn::after { content: ''; width: .45rem; height: .45rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); opacity: .6; transition: transform .2s; }
.nav-group.open > .nav-group-btn::after { transform: rotate(225deg) translateY(-2px); }
.nav-group.has-active > .nav-group-btn { color: var(--green-700); background: var(--green-50); }
.nav-dropdown { display: none; }
.nav-dropdown-head { padding: .5rem .75rem .6rem; border-bottom: 1px solid #edf2ef; margin-bottom: .25rem; }
.nav-dropdown-head b { display: block; color: #0f172a; font-size: .9rem; }
.nav-dropdown-head small { display: block; color: #64748b; font-size: .75rem; }
.nav-dropdown .nav-link.active::after { display: none; }
@media (min-width: 768px) {
    .nav-dropdown { position: absolute; top: calc(100% + .5rem); inset-inline-start: 0; z-index: 40; min-width: 14rem; padding: .4rem; background: #fff; border-radius: 1rem;
        border: 1px solid #e3ece6; box-shadow: 0 20px 48px rgba(11, 59, 36, .16), 0 2px 6px rgba(11, 59, 36, .06); }
    .nav-dropdown-wide:has(> li:not(.hidden) ~ li:not(.hidden) ~ li:not(.hidden) ~ li:not(.hidden) ~ li:not(.hidden)) { display: none; min-width: 26rem; }
    .nav-group.open > .nav-dropdown { display: block; animation: pop .18s cubic-bezier(.2, .8, .2, 1); }
    .nav-group.open > .nav-dropdown-wide:has(> li:not(.hidden) ~ li:not(.hidden) ~ li:not(.hidden) ~ li:not(.hidden) ~ li:not(.hidden)) { display: grid; grid-template-columns: 1fr 1fr; gap: .1rem; }
    .nav-dropdown-end { inset-inline-start: auto; inset-inline-end: 0; }
    .nav-dropdown .nav-link { padding: .55rem .75rem; border-radius: .6rem; white-space: nowrap; }
    #nav-menu > li > .nav-link { white-space: nowrap; }
}
@media (max-width: 767px) {
    #nav-menu { border-top: 1px solid #edf2ef; margin-top: .25rem; padding-top: .5rem; max-height: calc(100vh - 5rem); overflow-y: auto; }
    #nav-menu > .nav-group > .nav-group-btn { pointer-events: none; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #64748b; background: none; min-height: 0; padding: .9rem .75rem .3rem; }
    #nav-menu > .nav-group > .nav-group-btn::after { display: none; }
    #nav-menu > .nav-group > .nav-dropdown { display: grid; grid-template-columns: 1fr 1fr; gap: .15rem; }
    .nav-account .nav-dropdown { position: fixed; inset: auto .75rem auto .75rem; top: 4.5rem; z-index: 50; padding: .4rem; background: #fff; border-radius: 1rem; box-shadow: 0 20px 48px rgba(11, 59, 36, .2); }
    .nav-account.open .nav-dropdown { display: block; animation: pop .18s cubic-bezier(.2, .8, .2, 1); }
}

/* Dashboard groups: a small label with a line, like the menu's sections */
.dash-group-title { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--green-700); }
.dash-group-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, #cfe5d8, transparent); }
html[dir="rtl"] .dash-group-title::after { background: linear-gradient(270deg, #cfe5d8, transparent); }

/* --- Home page (index.php) ------------------------------------------------------------------------------------------- */
.home-hero { background: radial-gradient(1000px 520px at 85% -10%, rgba(0, 168, 89, .55), transparent 60%),
    linear-gradient(135deg, #0B3B24 0%, #00602F 45%, #007F43 100%); }
.home-glow { position: absolute; border-radius: 9999px; filter: blur(60px); pointer-events: none; }
.home-glow-1 { width: 26rem; height: 26rem; top: -8rem; inset-inline-start: -8rem; background: rgba(0, 168, 89, .35); }
.home-glow-2 { width: 20rem; height: 20rem; bottom: -6rem; inset-inline-end: 20%; background: rgba(197, 47, 51, .18); }
.step-card { background: #fff; border-radius: 1.25rem; padding: 1.5rem; border: 1px solid #e6efe9; box-shadow: 0 18px 44px rgba(11, 59, 36, .12);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s; }
.step-card:hover { transform: translateY(-4px); box-shadow: 0 26px 56px rgba(11, 59, 36, .16); }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 9999px; font-weight: 800; font-size: .9rem;
    color: #fff; background: linear-gradient(135deg, var(--green), var(--green-700)); box-shadow: 0 6px 14px rgba(0, 115, 61, .3); }
.service-card { display: flex; gap: 1rem; align-items: flex-start; padding: 1.35rem; background: #fff; border-radius: 1.25rem; border: 1px solid #e6efe9;
    box-shadow: 0 4px 16px rgba(11, 59, 36, .05); transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s, border-color .25s; }
.service-card:hover { transform: translateY(-3px); border-color: #b9dcc8; box-shadow: 0 18px 40px rgba(11, 59, 36, .12); }
.service-icon { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 3.25rem; height: 3.25rem; border-radius: 1rem; font-size: 1.6rem;
    background: linear-gradient(135deg, #E9F8EF, #CFEEDC); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.service-card:hover .service-icon { transform: scale(1.08) rotate(-5deg); }
.service-arrow { color: var(--green-600); font-weight: 700; opacity: .4; transition: transform .25s, opacity .25s; }
.service-card:hover .service-arrow { opacity: 1; transform: translateX(4px); }
html[dir="rtl"] .service-arrow { transform: scaleX(-1); }
html[dir="rtl"] .service-card:hover .service-arrow { transform: scaleX(-1) translateX(4px); }
.cta-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 2.25rem; border-radius: 1.5rem; color: #fff;
    background: radial-gradient(600px 300px at 90% 0%, rgba(0, 168, 89, .5), transparent 60%), linear-gradient(135deg, #0B3B24, #00733D);
    box-shadow: 0 24px 60px rgba(0, 96, 47, .28); }

/* --- Sign-in / account pages: a brand panel beside the form on wide screens -------------------------------------------- */
.auth-shell { display: grid; border-radius: 1.5rem; overflow: hidden; background: #fff; border: 1px solid #e3ece6; box-shadow: 0 30px 70px rgba(11, 59, 36, .14); }
@media (min-width: 768px) { .auth-shell { grid-template-columns: 1fr 1.05fr; } }
.auth-aside { display: none; padding: 2.5rem; color: #fff; position: relative; overflow: hidden;
    background: radial-gradient(500px 300px at 100% 0%, rgba(0, 168, 89, .55), transparent 60%), linear-gradient(160deg, #0B3B24, #00733D); }
@media (min-width: 768px) { .auth-aside { display: block; } }
.auth-tick { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border-radius: 9999px; background: rgba(255, 255, 255, .18); font-size: .75rem; font-weight: 800; }
.auth-card { padding: 2rem; }
@media (min-width: 768px) { .auth-card { padding: 2.75rem; } }

/* --- Cards everywhere: a hairline border and a soft two-layer shadow; lists of cards lift a little on hover ----------- */
.bg-white.rounded-xl.shadow-sm, .bg-white.rounded-2xl.shadow-sm, .bg-white.rounded-xl.shadow, .bg-white.rounded-xl.shadow-md {
    border: 1px solid #e8f0eb; box-shadow: 0 1px 2px rgba(11, 59, 36, .04), 0 8px 24px rgba(11, 59, 36, .06); }
button.bg-white.rounded-xl.shadow-sm, a.bg-white.rounded-xl.shadow-sm { transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s, border-color .2s; }
button.bg-white.rounded-xl.shadow-sm:hover, a.bg-white.rounded-xl.shadow-sm:hover { transform: translateY(-2px); border-color: #c9e3d4; box-shadow: 0 14px 32px rgba(11, 59, 36, .1); }
/* Tabs: bolder, a rounded indicator */
.tab { font-weight: 600; border-bottom-width: 3px; border-radius: .5rem .5rem 0 0; transition: color .2s, background .2s; }
.tab:hover { color: var(--green-700); background: rgba(0, 168, 89, .05); }
/* Page titles: a touch tighter */
main h1.text-3xl { letter-spacing: -.02em; }

/* --- Never wider than the phone: long selects shrink, wide tables scroll inside themselves ------------------------- */
select.form-input, input.form-input { max-width: 100%; }
@media (max-width: 767px) {
    .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .data-table th { white-space: nowrap; }
    main img, main iframe, main video { max-width: 100%; }
}

/* --- Mobile number: country picker (app.js PhoneInput) ------------------------------------------------------------ */
.phone-country { width: auto; flex-shrink: 0; display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; cursor: pointer; }
.phone-picker { position: absolute; top: calc(100% + .35rem); inset-inline-start: 0; z-index: 40; width: min(22rem, calc(100vw - 2rem));
    background: #fff; border: 1px solid #e2e8f0; border-radius: .75rem; box-shadow: 0 12px 32px rgba(15, 23, 42, .16); padding: .5rem; animation: fadeUp .15s both; }
.phone-picker ul { max-height: 16rem; overflow-y: auto; margin-top: .4rem; }
.phone-picker li[role="option"] { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; border-radius: .5rem; cursor: pointer; min-height: 40px; }
.phone-picker li[role="option"]:hover, .phone-picker li.active { background: var(--green-50); }
.phone-picker li[aria-selected="true"] { font-weight: 600; color: var(--green-700); }

/* --- Show / hide password (app.js PasswordToggle) ------------------------------------------------------------------ */
.password-field .form-input { padding-inline-end: 2.75rem; }
.password-eye { position: absolute; top: 50%; inset-inline-end: .25rem; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: .5rem; color: #56637A; }
.password-eye:hover { color: var(--green-700); background: var(--green-50); }
.password-eye:focus-visible { outline: 3px solid rgba(0, 168, 89, .45); outline-offset: 0; }

/* WhatsApp verification state (includes/whatsapp-verify.php) */
.wa-state { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .6rem; border-radius: 9999px; font-size: .75rem; font-weight: 600; border: 1px solid; }
.wa-state::before { content: ''; width: .5rem; height: .5rem; border-radius: 9999px; background: currentColor; }
.wa-state[data-wa-state="pending"] { color: #475569; background: #f8fafc; border-color: #cbd5e1; }
.wa-state[data-wa-state="waiting"] { color: #92400e; background: #fffbeb; border-color: #fcd34d; }
.wa-state[data-wa-state="verified"] { color: var(--green-700); background: #ecfdf5; border-color: #a7f3d0; }
.wa-state[data-wa-state="failed"] { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
/* Phones, signed in: Language moves from the full header bar to the top of the menu (header.php) */
@media (max-width: 767px) { html.has-token .lang-pill-bar { display: none; } }
@media (min-width: 768px) { .lang-menu-item { display: none !important; } }

/* First-login tour */
.tour-card { position: fixed; z-index: 60; inset-inline: 1rem; bottom: 1rem; max-width: 24rem; margin-inline: auto; background: #fff; border-radius: 1rem;
    padding: 1rem 1.1rem; box-shadow: 0 20px 50px rgba(15, 23, 42, .25); border: 1px solid #e2e8f0; }
.tour-lit { position: relative; z-index: 55; border-radius: .6rem; box-shadow: 0 0 0 3px var(--green), 0 0 0 9999px rgba(15, 23, 42, .35) !important; }
