/* ============================================================
   Odontoage - Master Stylesheet
   Mobile-first, RTL Arabic, app-like
   ============================================================ */

:root {
  --brand: #2C6B85;
  --brand-dark: #1F4D63;
  --brand-light: #4A8FA8;
  --brand-bg: #EAF1F4;
  --brand-bg-soft: #F4F8FA;

  --accent: #E8B85C;
  --accent-dark: #C99A3F;

  --bg: #FAF8F4;
  --surface: #FFFFFF;
  --surface-2: #F4F1EB;

  --text: #1A2E3A;
  --text-soft: #4A5A66;
  --text-mute: #7A8A95;
  --border: #E5E9EC;
  --border-strong: #C8D1D6;

  --success: #10B981;
  --success-bg: #D1FAE5;
  --warning: #F59E0B;
  --warning-bg: #FEF3C7;
  --danger: #EF4444;
  --danger-bg: #FEE2E2;
  --info: #3B82F6;
  --info-bg: #DBEAFE;

  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(15,30,45,0.04);
  --shadow: 0 4px 16px rgba(15,30,45,0.06);
  --shadow-lg: 0 20px 50px rgba(15,30,45,0.08);

  --container: 1100px;
  --container-narrow: 720px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Tajawal', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

h1, h2, h3, h4 {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  color: var(--text);
  margin: 0 0 .5em;
  font-weight: 700;
}
h1 { font-size: clamp(1.6rem, 2.8vw, 2.4rem); line-height: 1.2; }
h2 { font-size: clamp(1.3rem, 2.2vw, 1.8rem); line-height: 1.3; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; color: var(--text-soft); }

img, svg { max-width: 100%; display: block; }

/* ===== Layout ===== */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 1.25rem; }

.section { padding: 3rem 0; }
.section-tight { padding: 1.5rem 0; }

/* ===== Top bar / navigation ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Cairo', sans-serif;
  font-weight: 800; font-size: 1.4rem;
  color: var(--brand);
}
.brand img { width: 36px; height: 36px; }
.brand small {
  display: block; font-size: .65rem; font-weight: 500;
  color: var(--text-mute); margin-top: -2px;
}

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 8px 14px; border-radius: 10px;
  color: var(--text-soft); font-weight: 500; font-size: .92rem;
  transition: .15s;
}
.nav a:hover { background: var(--brand-bg); color: var(--brand); }
.nav a.active { background: var(--brand); color: white; }

.nav-mobile-btn {
  display: none; background: none; border: 0; padding: 8px; cursor: pointer;
  color: var(--text); border-radius: 8px;
}
.nav-mobile-btn:hover { background: var(--brand-bg); }

@media (max-width: 880px) {
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: white; padding: 1rem; flex-direction: column; align-items: stretch;
    gap: 4px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav-mobile-btn { display: inline-flex; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 22px; border-radius: 12px;
  font-weight: 600; font-size: .95rem; font-family: inherit;
  cursor: pointer; border: 1.5px solid transparent;
  transition: .15s ease;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--brand); color: white;
  box-shadow: 0 4px 14px rgba(44,107,133,0.25);
}
.btn-primary:hover { background: var(--brand-dark); color: white; }
.btn-outline {
  background: transparent; color: var(--brand); border-color: var(--brand);
}
.btn-outline:hover { background: var(--brand-bg); }
.btn-ghost {
  background: var(--surface); color: var(--text); border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-accent {
  background: var(--accent); color: var(--text);
}
.btn-accent:hover { background: var(--accent-dark); color: var(--text); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; color: white; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: .85rem; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== Form fields ===== */
.field { margin-bottom: 1.25rem; }
.field label {
  display: block; font-weight: 600; font-size: .9rem;
  color: var(--text); margin-bottom: 6px;
}
.field .hint { font-size: .8rem; color: var(--text-mute); margin-top: 4px; }
.input, .select, .textarea {
  width: 100%; padding: 12px 14px; font: inherit;
  background: var(--surface); color: var(--text);
  border: 1.5px solid var(--border); border-radius: 12px;
  transition: .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: 0; border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-bg);
}
.textarea { min-height: 110px; resize: vertical; font-family: inherit; }
.select { appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='%237A8A95' viewBox='0 0 16 16'%3E%3Cpath d='M3.204 5L8 10.481 12.796 5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center;
  padding-left: 38px;
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .field-grid { grid-template-columns: 1fr; } }

/* ===== Cards ===== */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.card-tight { padding: 1rem; }
.card-flat { box-shadow: none; }

/* ===== Hero ===== */
.hero {
  padding: 3rem 0 2.5rem;
  background: linear-gradient(180deg, var(--brand-bg-soft) 0%, var(--bg) 100%);
}
.hero-grid {
  display: flex;
  align-items: center;
  gap: 3rem;
}
.hero-grid > * { flex: 1 1 0; min-width: 0; }
@media (max-width: 880px) {
  .hero-grid { flex-direction: column; gap: 2rem; text-align: center; }
}
.hero h1 { color: var(--text); margin-bottom: .75rem; }
.hero .lead { font-size: 1.1rem; color: var(--text-soft); margin-bottom: 1.5rem; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 880px) { .hero-cta { justify-content: center; } }
.hero-visual {
  background: white; border-radius: var(--radius-xl);
  padding: 2rem; box-shadow: var(--shadow-lg);
  position: relative; overflow: visible;
}
.hero-visual::before {
  content: ""; position: absolute; top: -40px; right: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  background: var(--brand-bg);
  z-index: 0;
  opacity: 0.4;
}
.hero-visual > * { position: relative; z-index: 1; }
.hero-visual img { display: block; }

/* ===== Feature cards ===== */
.feature-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.feature-grid > * { flex: 1 1 260px; min-width: 0; }
.feature {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  transition: .2s;
}
.feature:hover {
  border-color: var(--brand); transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.feature-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--brand-bg); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px; font-size: 22px;
}
.feature h3 { margin-bottom: 6px; font-size: 1.05rem; }
.feature p { margin: 0; font-size: .92rem; }

/* ===== Steps (3-step illustration) ===== */
.steps {
  display: flex;
  gap: 1rem;
  margin: 2rem 0;
}
.steps > * { flex: 1 1 0; min-width: 0; }
@media (max-width: 720px) { .steps { flex-direction: column; } }
.step {
  background: var(--surface); padding: 1.25rem; border-radius: var(--radius-lg);
  border: 1px solid var(--border); position: relative;
}
.step-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand); color: white;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-family: 'Cairo'; margin-bottom: 10px;
}
.step h4 { margin: 0 0 4px; font-size: 1rem; }
.step p { margin: 0; font-size: .88rem; }

/* ===== Pricing cards ===== */
.pricing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem; margin: 2rem 0;
}
.price-card {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius-xl); padding: 2rem 1.5rem;
  text-align: center; position: relative;
}
.price-card.featured {
  border-color: var(--brand);
  box-shadow: 0 12px 40px rgba(44,107,133,0.15);
}
.price-card.featured::before {
  content: "الأكثر شيوعاً"; position: absolute;
  top: -12px; right: 50%; transform: translateX(50%);
  background: var(--brand); color: white;
  padding: 4px 14px; border-radius: 99px;
  font-size: .75rem; font-weight: 600;
}
.price-tag {
  font-family: 'Cairo'; font-size: 2.5rem; font-weight: 800;
  color: var(--brand); line-height: 1;
}
.price-tag small {
  font-size: .9rem; color: var(--text-mute); font-weight: 500;
}
.price-features { list-style: none; padding: 0; margin: 1.5rem 0; text-align: right; }
.price-features li {
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: .92rem; color: var(--text-soft);
  display: flex; align-items: center; gap: 8px;
}
.price-features li:last-child { border: 0; }
.price-features li::before {
  content: "✓"; color: var(--brand); font-weight: 700;
  width: 20px; height: 20px; display: inline-flex;
  align-items: center; justify-content: center;
  background: var(--brand-bg); border-radius: 50%; font-size: .75rem;
}

/* ===== Pills / badges ===== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 99px;
  font-size: .78rem; font-weight: 600;
}
.badge-success { background: var(--success-bg); color: #065F46; }
.badge-warning { background: var(--warning-bg); color: #92400E; }
.badge-danger { background: var(--danger-bg); color: #991B1B; }
.badge-info { background: var(--info-bg); color: #1E40AF; }
.badge-mute { background: var(--surface-2); color: var(--text-soft); }
.badge-brand { background: var(--brand-bg); color: var(--brand); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ===== Alert / notice ===== */
.alert {
  padding: 12px 16px; border-radius: 12px;
  border: 1px solid; font-size: .92rem;
  display: flex; gap: 10px; align-items: flex-start;
  margin-bottom: 1rem;
}
.alert-info { background: var(--info-bg); border-color: #BFDBFE; color: #1E40AF; }
.alert-success { background: var(--success-bg); border-color: #A7F3D0; color: #065F46; }
.alert-warning { background: var(--warning-bg); border-color: #FCD34D; color: #92400E; }
.alert-danger { background: var(--danger-bg); border-color: #FCA5A5; color: #991B1B; }

/* ===== Upload / dropzone ===== */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
  padding: 2rem 1rem; text-align: center;
  background: var(--brand-bg-soft); cursor: pointer;
  transition: .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-bg); }
.dropzone-icon {
  width: 56px; height: 56px; margin: 0 auto 12px;
  background: var(--surface); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--brand); font-size: 24px; box-shadow: var(--shadow-sm);
}
.preview-img {
  max-height: 280px; margin: 0 auto; border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ===== Tables (admin) ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 12px 14px; text-align: right; border-bottom: 1px solid var(--border); }
.table th { background: var(--surface-2); font-weight: 600; color: var(--text-soft); font-size: .82rem; }
.table tr:hover td { background: var(--brand-bg-soft); }
.table tr:last-child td { border: 0; }

/* ===== Stat cards (dashboard) ===== */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.stat {
  background: var(--surface); padding: 1.25rem;
  border-radius: var(--radius-lg); border: 1px solid var(--border);
}
.stat-label { font-size: .82rem; color: var(--text-mute); margin-bottom: 6px; }
.stat-value { font-family: 'Cairo'; font-size: 1.8rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-sub { font-size: .8rem; color: var(--text-mute); margin-top: 6px; }
.stat-icon {
  float: left; width: 44px; height: 44px;
  background: var(--brand-bg); color: var(--brand);
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
}

/* ===== Footer ===== */
.footer {
  background: var(--text); color: rgba(255,255,255,0.7);
  padding: 3rem 0 1.5rem; margin-top: 4rem;
}
.footer-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2rem; margin-bottom: 2rem;
}
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; } }
@media (max-width: 600px) { .footer-grid { grid-template-columns: 1fr; } }
.footer h4 { color: white; font-size: .95rem; margin-bottom: 12px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 8px; }
.footer a { color: rgba(255,255,255,0.6); font-size: .9rem; }
.footer a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1rem;
  text-align: center; font-size: .85rem;
}
.footer .brand { color: white; }
.footer .brand small { color: rgba(255,255,255,0.5); }

/* ===== Admin shell ===== */
.admin-layout {
  display: grid; grid-template-columns: 250px 1fr; min-height: 100vh;
}
.admin-sidebar {
  background: var(--text); color: white;
  padding: 1.5rem 0;
}
.admin-sidebar .brand { color: white; padding: 0 1.5rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.admin-sidebar .brand small { color: rgba(255,255,255,0.5); }
.admin-nav { padding: 1rem 0; }
.admin-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 1.5rem; color: rgba(255,255,255,0.7);
  font-size: .92rem; transition: .15s;
}
.admin-nav a:hover { background: rgba(255,255,255,0.05); color: white; }
.admin-nav a.active { background: var(--brand); color: white; border-right: 3px solid var(--accent); }
.admin-nav .nav-label { font-size: .75rem; text-transform: uppercase; letter-spacing: 1px;
  color: rgba(255,255,255,0.4); padding: 1rem 1.5rem .5rem; }
.admin-main {
  padding: 1.5rem 2rem; background: var(--bg);
}
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border);
}
.admin-topbar h1 { font-size: 1.6rem; margin: 0; }

@media (max-width: 880px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: fixed; top: 0; right: -260px; width: 250px;
    height: 100vh; z-index: 100; transition: .3s; box-shadow: -10px 0 40px rgba(0,0,0,0.2); }
  .admin-sidebar.open { right: 0; }
  .admin-main { padding: 1rem; }
}

/* ===== Mobile app-like styling ===== */
.app-shell {
  background: var(--brand-bg-soft);
  min-height: 100vh; padding-bottom: 80px;
}

/* ===== Utility ===== */
.text-center { text-align: center; }
.text-mute { color: var(--text-mute); }
.text-soft { color: var(--text-soft); }
.text-brand { color: var(--brand); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.hidden { display: none; }

/* ===== Section title ===== */
.sec-title {
  text-align: center; margin-bottom: 2rem;
}
.sec-title .eyebrow {
  display: inline-block; background: var(--brand-bg); color: var(--brand);
  padding: 4px 12px; border-radius: 99px;
  font-size: .8rem; font-weight: 600; margin-bottom: 12px;
}
.sec-title h2 { margin-bottom: 6px; }
.sec-title p { max-width: 600px; margin: 0 auto; }

/* ===== Loader ===== */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.dots-loader { display: inline-flex; gap: 4px; }
.dots-loader span {
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand);
  animation: bounce 1.4s infinite ease-in-out both;
}
.dots-loader span:nth-child(2) { animation-delay: -0.16s; }
.dots-loader span:nth-child(3) { animation-delay: -0.32s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

/* ===== Result page ===== */
.score-card {
  background: linear-gradient(135deg, var(--text) 0%, #2A3F4D 100%);
  color: white; border-radius: var(--radius-xl); padding: 1.75rem;
  position: relative; overflow: hidden;
}
.score-card::before {
  content: ""; position: absolute; top: -50px; right: -50px;
  width: 200px; height: 200px; background: rgba(74,143,168,0.2);
  border-radius: 50%; filter: blur(60px);
}
.score-row { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.score-big { font-family: 'Cairo'; font-size: 3.5rem; font-weight: 800; line-height: 1; }
.score-big small { font-size: 1rem; color: rgba(255,255,255,0.5); font-weight: 500; }
.score-ring {
  width: 80px; height: 80px; border-radius: 50%; border: 6px solid;
  display: flex; align-items: center; justify-content: center;
}

.issue-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; margin-bottom: 8px;
}
.issue-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.issue-head h4 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: 8px; }

/* ===== Compatibility ===== */
@media print {
  .topbar, .footer, .btn { display: none; }
}

/* ============================================================
   HUMAN TOUCH ADDITIONS (v2)
   Hand-drawn underlines, softer shadows, centered service cards,
   image-backed cards, footer grid fixes
   ============================================================ */

/* Hand-drawn squiggle/underline under headings */
.handwritten-underline {
  position: relative; display: inline-block;
}
.handwritten-underline::after {
  content: ""; position: absolute;
  bottom: -8px; left: 0; right: 0; height: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 8' preserveAspectRatio='none'%3E%3Cpath d='M2 5 Q 25 1, 50 4 T 100 3 T 150 5 T 198 3' stroke='%232C6B85' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: 100% 100%; background-repeat: no-repeat;
}
.handwritten-underline.accent::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 8' preserveAspectRatio='none'%3E%3Cpath d='M2 5 Q 25 1, 50 4 T 100 3 T 150 5 T 198 3' stroke='%23E8B85C' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Hand-drawn highlight (brush behind word) */
.brush-highlight {
  position: relative; display: inline-block; z-index: 1;
  padding: 0 4px;
}
.brush-highlight::before {
  content: ""; position: absolute;
  bottom: -2px; left: -4px; right: -4px; top: 60%;
  background: rgba(232, 184, 92, 0.35);
  z-index: -1; border-radius: 99px 4px 99px 4px;
  transform: rotate(-0.5deg);
}

/* Soft hand-drawn divider */
.hand-divider {
  display: flex; justify-content: center; margin: 1rem 0;
}
.hand-divider svg { opacity: 0.4; }

/* Section title (no eyebrow badge, with underline instead) */
.sec-title-2 {
  text-align: center; margin-bottom: 2.5rem;
}
.sec-title-2 h2 {
  display: inline-block; position: relative;
  margin-bottom: 1rem;
}
.sec-title-2 h2::after {
  content: ""; position: absolute;
  bottom: -10px; left: 10%; right: 10%; height: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 8' preserveAspectRatio='none'%3E%3Cpath d='M2 5 Q 25 1, 50 4 T 100 3 T 150 5 T 198 3' stroke='%232C6B85' stroke-width='2.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: 100% 100%; background-repeat: no-repeat;
}
.sec-title-2 p { max-width: 620px; margin: 1.5rem auto 0; }

/* Stats row - FLEX 3 columns ALWAYS (universal support) */
.hero-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  text-align: center;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.hero-stats-row > div {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}
.hero-stat-value {
  font-family: 'Cairo'; font-size: 1.5rem; color: var(--brand);
  font-weight: 700; line-height: 1; margin-bottom: 6px;
}
.hero-stat-label {
  font-size: .82rem; color: var(--text-mute);
}

/* Service cards v2 (centered content, no top stripe, with bg image) */
.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem 1.75rem;
  position: relative; overflow: hidden;
  transition: .25s ease;
}
.service-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 50px rgba(15,30,45,0.08);
  border-color: var(--brand);
}
.service-card-bg {
  position: absolute; bottom: -30px; left: -30px;
  width: 240px; height: 240px;
  background-size: cover; background-position: center;
  opacity: 0.12; z-index: 0;
  border-radius: 50%;
  filter: grayscale(15%);
  pointer-events: none;
}
.service-card > * { position: relative; z-index: 1; }
.service-card-title {
  text-align: center; margin-bottom: 8px;
  font-size: 1.2rem; font-weight: 700;
}
.service-card-desc {
  text-align: center; color: var(--text-soft);
  font-size: .94rem; margin-bottom: 1.25rem;
  line-height: 1.7;
}
/* Features list: centered text, NO bullets, NO dashes */
.service-card-features {
  list-style: none; padding: 0; margin: 0 0 1.5rem;
  text-align: center;
}
.service-card-features li {
  padding: 6px 0;
  color: var(--text);
  font-size: .92rem;
}

/* Step card centered v2 */
.step-2 {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  text-align: center;
  transition: .2s;
}
.step-2:hover {
  border-color: var(--brand);
  box-shadow: 0 8px 24px rgba(15,30,45,0.06);
}
.step-2 .step-num {
  margin: 0 auto 12px;
}
.step-2 h4 { text-align: center; }
.step-2 p { text-align: center; }

/* Hero visual card centered (no badge dot) */
.hv-card-centered {
  text-align: center;
}
.hv-card-centered .hv-status {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--text);
}

/* Footer grid (legacy class - unused but kept for compatibility) */
.footer-grid-2 {
  display: grid;
  grid-template-columns: 1.5fr 1.2fr;
  gap: 2rem; margin-bottom: 2rem;
}

/* ===== MOBILE FOOTER: SUPER MINIMAL — only logo + key links + copyright ===== */
@media (max-width: 600px) {
  .footer {
    padding: 1.5rem 0 1rem;
    margin-top: 2rem;
  }
  .footer-v3 {
    gap: 1rem !important;
    margin-bottom: 1rem !important;
  }
  /* Compact brand block: just tiny logo + name */
  .footer-v3 .ft-about .brand {
    margin-bottom: 0 !important;
    justify-content: center;
  }
  .footer-v3 .ft-about .brand img {
    width: 28px !important;
  }
  .footer-v3 .ft-about .brand span {
    font-size: .95rem;
  }
  .footer-v3 .ft-about .brand small {
    display: none;
  }
  /* HIDE the long description on mobile */
  .footer-v3 .ft-about p {
    display: none !important;
  }
  /* HIDE the entire contact column (info + form + button) */
  .footer-v3 .ft-contact-form {
    display: none !important;
  }
  /* Center the links section */
  .footer-v3 .ft-links {
    gap: 2rem !important;
    justify-content: center;
  }
  .footer h4 {
    font-size: .82rem !important;
    margin-bottom: 8px !important;
    text-align: center;
  }
  .footer ul {
    text-align: center;
  }
  .footer li {
    margin-bottom: 6px !important;
  }
  .footer a {
    font-size: .85rem !important;
  }
  /* Footer bottom tighter */
  .footer-bottom {
    padding-top: 0.75rem !important;
    font-size: .72rem !important;
    line-height: 1.5;
    text-align: center;
  }
  .footer-bottom p {
    margin: 0 !important;
  }
}

/* Mini contact form in footer */
.footer-form {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 1rem; border-radius: var(--radius);
}
.footer-form h4 { margin-top: 0; margin-bottom: 8px; color: white; font-size: .92rem; }
.footer-form .field { margin-bottom: 8px; }
.footer-form input, .footer-form textarea {
  width: 100%; background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: white; padding: 8px 10px;
  border-radius: 8px; font: inherit;
  font-size: .85rem;
}
.footer-form input::placeholder, .footer-form textarea::placeholder { color: rgba(255,255,255,0.5); }
.footer-form input:focus, .footer-form textarea:focus {
  outline: none; border-color: var(--accent);
}
.footer-form textarea { min-height: 60px; resize: vertical; font-family: inherit; }
.footer-form button {
  width: 100%; background: var(--accent-dark); color: white;
  border: 0; padding: 8px 12px; border-radius: 8px;
  font-weight: 600; font-size: .85rem; cursor: pointer;
  transition: .15s; font-family: inherit;
}
.footer-form button:hover { background: var(--accent); color: var(--text); }
.footer-form .form-msg {
  font-size: .8rem; padding: 6px 8px; border-radius: 6px;
  background: rgba(16,185,129,0.2); color: #6ee7b7;
  margin-bottom: 8px;
}

/* Hero with real photo background */
.hero-with-photo {
  position: relative;
  background-image:
    linear-gradient(180deg, rgba(244,248,250,0.80) 0%, rgba(250,248,244,0.88) 100%),
    url('https://images.pexels.com/photos/3845761/pexels-photo-3845761.jpeg?auto=compress&cs=tinysrgb&w=1600');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Soft body texture (subtle paper feel) */
body {
  background-image:
    radial-gradient(rgba(44, 107, 133, 0.025) 1px, transparent 1px),
    radial-gradient(rgba(44, 107, 133, 0.025) 1px, transparent 1px);
  background-size: 28px 28px, 28px 28px;
  background-position: 0 0, 14px 14px;
}

/* Softer button shadow */
.btn-primary {
  box-shadow: 0 6px 20px rgba(44,107,133,0.18), 0 2px 4px rgba(44,107,133,0.1);
}

/* ============================================================
   TOOL-FIRST HOMEPAGE (v3)
   ============================================================ */

.tool-section {
  padding: 2.5rem 0 3rem;
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  background:
    radial-gradient(ellipse at top right, rgba(74,143,168,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(232,184,92,0.06) 0%, transparent 50%),
    linear-gradient(180deg, var(--brand-bg-soft) 0%, var(--bg) 100%);
}

/* With a real dental image background, very subtle */
.tool-section-image {
  background:
    linear-gradient(180deg, rgba(244,248,250,0.92) 0%, rgba(250,248,244,0.96) 100%),
    url('https://images.pexels.com/photos/3845761/pexels-photo-3845761.jpeg?auto=compress&cs=tinysrgb&w=1600') center/cover no-repeat;
}

.tool-intro {
  text-align: center;
  margin-bottom: 1.75rem;
}
.tool-intro h1 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  margin-bottom: 12px;
  line-height: 1.25;
}
.tool-intro p {
  font-size: 1.05rem;
  color: var(--text-soft);
  margin: 0;
  max-width: 480px;
  margin-inline: auto;
}

.tool-form {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(15,30,45,0.08), 0 4px 12px rgba(15,30,45,0.04);
}

/* Dropzone - the star of the homepage */
.tool-dropzone {
  position: relative;
  border: 2.5px dashed var(--border-strong);
  background: var(--brand-bg-soft);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: .2s;
  margin-bottom: 1.25rem;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.tool-dropzone:hover,
.tool-dropzone.drag {
  border-color: var(--brand);
  background: var(--brand-bg);
}
.tool-dropzone.drag {
  border-style: solid;
}

.tool-dropzone-icon {
  width: 72px; height: 72px; margin-bottom: 14px;
  background: white;
  color: var(--brand);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(44,107,133,0.18);
  transition: .2s;
}
.tool-dropzone:hover .tool-dropzone-icon {
  transform: scale(1.05);
}

.tool-dropzone-text strong {
  display: block; font-size: 1.1rem; color: var(--text);
  margin-bottom: 6px;
  font-family: 'Cairo';
  font-weight: 700;
}
.tool-dropzone-text span {
  font-size: .9rem; color: var(--text-mute);
}

.tool-preview {
  max-height: 240px;
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.tool-preview.hidden { display: none; }
.tool-dropzone-text.hidden { display: none; }

.tool-clear {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--text);
  color: white;
  border: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: .15s;
}
.tool-clear:hover { background: var(--danger); }
.tool-clear.hidden { display: none; }

/* Common label */
.tool-label {
  display: block;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

/* Age + Gender row */
.tool-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 1rem;
}
@media (max-width: 480px) {
  .tool-row-2 { grid-template-columns: 1fr; }
}

.tool-age-input {
  position: relative;
  display: flex; align-items: center;
}
.tool-age-input input {
  width: 100%;
  padding: 12px 16px;
  padding-left: 60px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 1.05rem;
  font-family: 'Cairo';
  font-weight: 700;
  color: var(--brand);
  text-align: center;
  background: white;
  transition: .15s;
}
.tool-age-input input:focus {
  outline: 0;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-bg);
}
.tool-age-input span {
  position: absolute;
  left: 16px;
  font-size: .85rem;
  color: var(--text-mute);
  pointer-events: none;
}

.tool-select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  font-family: 'Tajawal';
  background: white;
  color: var(--text);
  cursor: pointer;
  transition: .15s;
}
.tool-select:focus {
  outline: 0;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-bg);
}

/* Pain area chips */
.tool-pain { margin-bottom: 1rem; }
.pain-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pain-chips input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.pain-chip {
  display: inline-flex;
  padding: 8px 14px;
  background: var(--brand-bg-soft);
  border: 1.5px solid var(--border);
  border-radius: 99px;
  color: var(--text-soft);
  font-size: .85rem;
  cursor: pointer;
  transition: .15s;
  user-select: none;
}
.pain-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.pain-chips input[type="radio"]:checked + .pain-chip {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
  font-weight: 600;
}

.tool-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: .92rem;
  font-family: 'Tajawal';
  color: var(--text);
  background: white;
  resize: vertical;
  transition: .15s;
  margin-bottom: 1rem;
}
.tool-textarea:focus {
  outline: 0;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-bg);
}

.tool-submit {
  background: var(--brand);
  color: white;
  border: 0;
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: 'Cairo';
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 22px rgba(44,107,133,0.25), 0 2px 4px rgba(44,107,133,0.1);
  transition: .15s;
}
.tool-submit-full { width: 100%; }
.tool-submit:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(44,107,133,0.3);
}
.tool-submit:disabled {
  opacity: .7; cursor: not-allowed; transform: none;
}

/* Mini steps below tool */
.mini-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 2rem 0 1.25rem;
  flex-wrap: wrap;
  font-size: .9rem;
}
.mini-step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
}
.mini-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  background: white;
  color: var(--brand);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  font-weight: 700;
  font-family: 'Cairo';
  font-size: .85rem;
}
.mini-step-arrow {
  color: var(--text-mute);
  font-size: 1rem;
}
.mini-step-time {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-bg);
  color: var(--brand);
  padding: 4px 12px;
  border-radius: 99px;
  font-weight: 600;
  font-size: .85rem;
}

@media (max-width: 600px) {
  .mini-steps { gap: 8px; font-size: .82rem; }
  .mini-step-arrow { display: none; }
}

/* Clinic callout */
.clinic-callout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 2rem;
  padding: 14px 20px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 99px;
  text-decoration: none;
  color: var(--text-soft);
  font-size: .92rem;
  transition: .15s;
  max-width: 420px;
  margin-inline: auto;
}
.clinic-callout strong { color: var(--brand); font-weight: 700; }
.clinic-callout:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(44,107,133,0.1);
}

/* Spinner in submit button */
.tool-submit .spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* SVG icons (line art style matching logo) */
.icon-line {
  width: 28px; height: 28px;
  stroke: var(--brand);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Feature icon container - softer, more organic */
.feature-icon-line {
  width: 56px; height: 56px;
  background: var(--brand-bg);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  color: var(--brand);
}
.feature-icon-line.accent {
  background: #FFF5E5;
  color: var(--accent-dark);
}

/* ============================================================
   FOOTER REBUILD v3
   Proper grid: works on desktop, tablet, mobile cleanly
   ============================================================ */

.footer-v3 {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  margin-bottom: 2rem;
  align-items: flex-start;
}
.footer-v3 > * { flex: 1 1 250px; min-width: 0; }
.footer-v3 .ft-about { flex: 1.2 1 280px; }
.footer-v3 .ft-links {
  display: flex;
  gap: 1.5rem;
}
.footer-v3 .ft-links > div { flex: 1 1 0; }
.footer-v3 .ft-contact-form { flex: 1.2 1 260px; }

@media (max-width: 760px) {
  .footer-v3 { 
    flex-direction: column; 
    gap: 1.5rem;
    align-items: stretch;
  }
  /* CRITICAL: don't let flex-grow stretch children vertically */
  .footer-v3 > * { flex: 0 0 auto !important; width: 100%; }
}
