/* ═══════════════════════════════════════════
   TMCG NURSERY — Warm Montessori Nature System
   ═══════════════════════════════════════════ */

:root {
  /* Palette — earthy Montessori nursery */
  --color-forest: #2d4a2b;
  --color-moss: #5a7d47;
  --color-sage: #8ba871;
  --color-sage-soft: #c4d4b0;
  --color-cream: #f9f5eb;
  --color-cream-warm: #f4ead5;
  --color-terracotta: #c67b58;
  --color-terracotta-soft: #e8c4a8;
  --color-ink: #2a2620;
  --color-ink-soft: #5c554a;
  --color-border: #d9cfb8;
  --color-white: #ffffff;

  /* Type */
  --font-display: 'Fraunces', 'Cairo', Georgia, serif;
  --font-body: 'DM Sans', 'Cairo', system-ui, sans-serif;
  --font-ar: 'Cairo', system-ui, sans-serif;

  /* Space */
  --sp-xs: 0.5rem;
  --sp-sm: 0.75rem;
  --sp-md: 1rem;
  --sp-lg: 1.5rem;
  --sp-xl: 2.5rem;
  --sp-2xl: 4rem;

  /* Radius */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 24px;
  --r-full: 999px;

  /* Shadow */
  --shadow-sm: 0 2px 8px rgba(45, 74, 43, 0.06);
  --shadow-md: 0 8px 24px rgba(45, 74, 43, 0.08);
  --shadow-lg: 0 20px 48px rgba(45, 74, 43, 0.12);
}

/* ═══ RESET ═══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-ink);
  background: var(--color-cream);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html[dir="rtl"] body { font-family: var(--font-ar); }
input, select, textarea, button { font: inherit; color: inherit; }

/* ═══ HERO ═══ */
.hero {
  position: relative;
  min-height: 96vh;
  background:
    radial-gradient(ellipse at top right, rgba(140, 168, 113, 0.25), transparent 55%),
    radial-gradient(ellipse at bottom left, rgba(198, 123, 88, 0.15), transparent 50%),
    linear-gradient(160deg, #f4ead5 0%, #ebe0c4 100%);
  padding: var(--sp-md) 6vw var(--sp-2xl);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(90, 125, 71, 0.08) 0, transparent 3%),
    radial-gradient(circle at 85% 30%, rgba(198, 123, 88, 0.1) 0, transparent 3%),
    radial-gradient(circle at 25% 75%, rgba(90, 125, 71, 0.06) 0, transparent 2.5%),
    radial-gradient(circle at 75% 85%, rgba(139, 168, 113, 0.08) 0, transparent 3%);
  background-size: 400px 400px;
  pointer-events: none;
}

.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-md) 0 var(--sp-2xl);
  position: relative;
  z-index: 2;
}
.brand { display: flex; align-items: center; }
.logo-img {
  height: 52px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(45, 74, 43, 0.08));
}
@media (max-width: 640px) { .logo-img { height: 42px; } }

.lang-toggle {
  display: flex;
  background: var(--color-cream);
  border: 1.5px solid var(--color-border);
  border-radius: var(--r-full);
  padding: 3px;
}
.lang-btn {
  padding: 0.4rem 1rem;
  border: none;
  background: transparent;
  border-radius: var(--r-full);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.25s;
  color: var(--color-ink-soft);
}
.lang-btn.active { background: var(--color-forest); color: var(--color-cream); }

.hero-content { position: relative; z-index: 2; max-width: 1200px; padding-top: var(--sp-xl); display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--sp-2xl); align-items: center; }
@media (max-width: 900px) { .hero-content { grid-template-columns: 1fr; gap: var(--sp-xl); } }

/* Hero collage — real photos */
.hero-collage {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 520px;
  width: 100%;
  justify-self: end;
}
html[dir="rtl"] .hero-collage { justify-self: start; }
.collage-item {
  position: absolute;
  overflow: hidden;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  border: 4px solid var(--color-cream);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.collage-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.collage-item:hover { transform: translateY(-4px) scale(1.02); z-index: 10; }
.collage-1 { top: 0; left: 0; width: 55%; height: 55%; transform: rotate(-3deg); }
.collage-2 { top: 8%; right: 0; width: 45%; height: 45%; transform: rotate(2deg); }
.collage-3 { bottom: 0; left: 8%; width: 50%; height: 45%; transform: rotate(4deg); }
.collage-4 { bottom: 5%; right: 3%; width: 45%; height: 50%; transform: rotate(-2deg); border-radius: var(--r-lg); }
@media (max-width: 900px) {
  .hero-collage { max-width: 400px; margin: 0 auto; }
}
@media (max-width: 500px) {
  .hero-collage { max-width: 320px; }
}

.hero-left { min-width: 0; }
.hero-bloom {
  position: absolute;
  top: -80px;
  inset-inline-end: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(90, 125, 71, 0.15), transparent 65%);
  border-radius: 50%;
  filter: blur(20px);
  animation: bloom 12s ease-in-out infinite;
}
@keyframes bloom { 0%,100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.1) rotate(20deg); } }

.eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-terracotta);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  border: 1px solid var(--color-terracotta-soft);
  border-radius: var(--r-full);
  background: rgba(232, 196, 168, 0.3);
  margin-bottom: var(--sp-lg);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  line-height: 1.05;
  font-weight: 500;
  color: var(--color-forest);
  margin-bottom: var(--sp-lg);
  letter-spacing: -0.02em;
}
html[dir="rtl"] .hero-title { font-family: var(--font-ar); font-weight: 700; letter-spacing: -0.01em; }
.hero-line { display: block; }
.hero-accent {
  font-style: italic;
  color: var(--color-terracotta);
  position: relative;
  padding-inline-start: 0.2em;
}
html[dir="rtl"] .hero-accent { font-style: normal; }

.hero-sub {
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: var(--color-ink-soft);
  max-width: 560px;
  margin-bottom: var(--sp-xl);
  line-height: 1.7;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 1rem 2rem;
  background: var(--color-forest);
  color: var(--color-cream);
  border-radius: var(--r-full);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-md);
}
.cta-btn:hover { background: var(--color-moss); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
html[dir="rtl"] .cta-btn svg { transform: rotate(180deg); }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-lg);
  margin-top: var(--sp-xl);
  padding-top: var(--sp-lg);
  border-top: 1px dashed var(--color-border);
  color: var(--color-ink-soft);
  font-size: 0.9rem;
}
.meta-item { display: flex; align-items: center; gap: 0.4rem; }
.meta-item svg { color: var(--color-moss); }

.hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 60px;
  z-index: 1;
}

/* ═══ GALLERY STRIP ═══ */
.gallery-strip {
  padding: var(--sp-2xl) 6vw;
  background: var(--color-cream);
  position: relative;
}
.gallery-head {
  text-align: center;
  margin-bottom: var(--sp-xl);
  max-width: 700px;
  margin-inline: auto;
}
.gallery-head .eyebrow { margin-bottom: var(--sp-md); }
.gallery-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 500;
  color: var(--color-forest);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
html[dir="rtl"] .gallery-title { font-family: var(--font-ar); font-weight: 700; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 200px 200px;
  gap: var(--sp-md);
  max-width: 1200px;
  margin: 0 auto;
}
.gallery-card {
  overflow: hidden;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.gallery-card:hover { transform: translateY(-6px) scale(1.02); box-shadow: var(--shadow-lg); }
.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}
.gallery-card:hover img { transform: scale(1.08); }
.gallery-tall { grid-row: 1 / span 2; grid-column: 1; }

@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, 180px); }
  .gallery-tall { grid-row: 1 / span 2; grid-column: 1; }
}
@media (max-width: 500px) {
  .gallery-grid { grid-template-columns: 1fr; grid-template-rows: repeat(5, 200px); }
  .gallery-tall { grid-row: auto; grid-column: auto; }
}

/* Footer logo */
.footer-logo {
  height: 48px;
  width: auto;
  display: block;
  margin-bottom: var(--sp-sm);
  background: var(--color-cream);
  padding: 6px 10px;
  border-radius: var(--r-sm);
}

/* ═══ PROGRESS ═══ */
.progress-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(249, 245, 235, 0.92);
  backdrop-filter: blur(12px);
  padding: var(--sp-sm) 6vw;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}
.progress-track {
  flex: 1;
  height: 6px;
  background: var(--color-sage-soft);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-moss), var(--color-terracotta));
  border-radius: var(--r-full);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-forest);
  min-width: 100px;
  text-align: end;
}

/* ═══ FORM ═══ */
.form-main {
  max-width: 780px;
  margin: 0 auto;
  padding: var(--sp-2xl) 6vw var(--sp-2xl);
}

.form-section {
  display: none;
  animation: fadeIn 0.5s ease-out;
}
.form-section.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-head {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-md);
  margin-bottom: var(--sp-xl);
  padding-bottom: var(--sp-lg);
  border-bottom: 2px dashed var(--color-sage-soft);
}
.section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--color-moss), var(--color-forest));
  color: var(--color-cream);
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 500;
  color: var(--color-forest);
  line-height: 1.2;
  margin-bottom: 0.25rem;
}
html[dir="rtl"] .section-head h2 { font-family: var(--font-ar); font-weight: 700; }
.section-head p { color: var(--color-ink-soft); font-size: 0.95rem; }

/* Fields */
.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-md);
}
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field-wide { grid-column: 1 / -1; }
.field > span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-forest);
}
.field input, .field select, .field textarea {
  padding: 0.75rem 1rem;
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--r-md);
  font-size: 0.95rem;
  transition: all 0.2s;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 60px; font-family: inherit; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--color-moss);
  box-shadow: 0 0 0 4px rgba(139, 168, 113, 0.15);
  background: var(--color-cream);
}
.field input:invalid:not(:placeholder-shown) { border-color: #d97757; }

/* Consent group */
.consent-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  margin-top: var(--sp-lg);
  padding: var(--sp-lg);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-sm);
  cursor: pointer;
  padding: var(--sp-sm);
  border-radius: var(--r-md);
  transition: background 0.2s;
  line-height: 1.5;
}
.checkbox:hover { background: var(--color-cream); }
.checkbox input {
  margin-top: 3px;
  width: 20px; height: 20px;
  flex-shrink: 0;
  accent-color: var(--color-forest);
  cursor: pointer;
}
.checkbox span { flex: 1; font-size: 0.95rem; }

/* Pickup/Emergency blocks */
.person-block {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  margin-bottom: var(--sp-md);
  box-shadow: var(--shadow-sm);
}
.person-block h3 {
  font-family: var(--font-display);
  color: var(--color-terracotta);
  margin-bottom: var(--sp-md);
  font-size: 1.15rem;
  font-weight: 600;
}
html[dir="rtl"] .person-block h3 { font-family: var(--font-ar); font-weight: 700; }
.person-block .fields { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Charter box */
.charter-box {
  background: linear-gradient(135deg, rgba(90, 125, 71, 0.08), rgba(198, 123, 88, 0.08));
  border: 2px dashed var(--color-sage);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  margin-bottom: var(--sp-lg);
}
.charter-icons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  justify-content: center;
}
.charter-icons span {
  padding: 0.5rem 1rem;
  background: var(--color-white);
  border-radius: var(--r-full);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-forest);
  box-shadow: var(--shadow-sm);
}

/* Nav buttons */
.form-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-md);
  margin-top: var(--sp-2xl);
  padding-top: var(--sp-lg);
  border-top: 1px dashed var(--color-border);
}
.btn-primary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 0.85rem 1.75rem;
  border-radius: var(--r-full);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s;
  border: none;
}
.btn-primary { background: var(--color-forest); color: var(--color-cream); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--color-moss); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: transparent;
  color: var(--color-forest);
  border: 1.5px solid var(--color-border);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--color-moss); background: var(--color-cream); }
.btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }
html[dir="rtl"] .btn-primary svg, html[dir="rtl"] .btn-ghost svg { transform: rotate(180deg); }
html[dir="rtl"] #submitBtn svg, html[dir="rtl"] .cta-btn svg { transform: rotate(0); }

/* ═══ SUCCESS OVERLAY ═══ */
.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 74, 43, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: var(--sp-lg);
  backdrop-filter: blur(8px);
}
.success-overlay.active { display: flex; animation: fadeIn 0.3s; }
.success-card {
  background: var(--color-cream);
  border-radius: var(--r-lg);
  padding: var(--sp-2xl) var(--sp-xl);
  text-align: center;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: cardIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes cardIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success-icon { color: var(--color-moss); margin-bottom: var(--sp-md); }
.success-card h2 {
  font-family: var(--font-display);
  color: var(--color-forest);
  font-size: 1.75rem;
  margin-bottom: var(--sp-sm);
  font-weight: 500;
}
html[dir="rtl"] .success-card h2 { font-family: var(--font-ar); font-weight: 700; }
.success-card p { color: var(--color-ink-soft); margin-bottom: var(--sp-lg); }
.success-contact {
  display: flex;
  justify-content: center;
  gap: var(--sp-md);
  flex-wrap: wrap;
  margin-bottom: var(--sp-lg);
  padding: var(--sp-md);
  background: var(--color-white);
  border-radius: var(--r-md);
  color: var(--color-forest);
  font-weight: 600;
  font-size: 0.9rem;
}

/* ═══ FOOTER ═══ */
.footer {
  background: var(--color-forest);
  color: var(--color-cream);
  padding: var(--sp-2xl) 6vw var(--sp-lg);
  margin-top: var(--sp-2xl);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-xl);
  margin-bottom: var(--sp-xl);
}
.footer h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: var(--sp-sm);
  color: var(--color-sage-soft);
  font-weight: 500;
}
html[dir="rtl"] .footer h4 { font-family: var(--font-ar); font-weight: 700; }
.footer p { margin-bottom: 0.35rem; font-size: 0.9rem; opacity: 0.9; }
.footer .logo { color: var(--color-sage-soft); margin-bottom: var(--sp-sm); }
.footer-brand { font-family: var(--font-display); font-size: 1.05rem; font-weight: 500; margin-bottom: 0.2rem; }
.footer-brand-ar { font-family: var(--font-ar); font-size: 0.9rem; opacity: 0.8; }
.footer-legal {
  padding-top: var(--sp-lg);
  border-top: 1px solid rgba(249, 245, 235, 0.15);
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.7;
}

/* ═══ MOBILE ═══ */
@media (max-width: 640px) {
  .topnav { flex-direction: column; gap: var(--sp-sm); align-items: flex-start; }
  .lang-toggle { align-self: flex-end; }
  .brand-text { font-size: 0.9rem; }
  .hero { padding: var(--sp-md) 5vw var(--sp-xl); min-height: auto; }
  .hero-content { padding-top: var(--sp-md); }
  .progress-wrap { padding: var(--sp-sm) 4vw; }
  .form-main { padding: var(--sp-xl) 5vw; }
  .form-nav { flex-direction: column; }
  .form-nav button { width: 100%; justify-content: center; }
  .section-number { width: 40px; height: 40px; font-size: 1rem; }
}

/* ═══ PRINT ═══ */
@media print {
  .hero, .footer, .progress-wrap, .form-nav, .lang-toggle { display: none; }
  .form-section { display: block !important; page-break-after: always; }
}

/* ═══ SIGNATURE PAD ═══ */
.signature-block {
  margin: 24px 0;
  padding: 20px;
  background: #fdfaf3;
  border: 2px dashed #8ba871;
  border-radius: 12px;
}
.signature-label {
  display: block;
  font-weight: 700;
  color: #2d4a2b;
  font-size: 15px;
  margin-bottom: 10px;
}
.signature-label small {
  display: block;
  font-weight: normal;
  color: #666;
  font-size: 12px;
  margin-top: 4px;
}
.signature-pad {
  display: block;
  width: 100%;
  max-width: 600px;
  height: 180px;
  background: #fff;
  border: 1px solid #d4c9a8;
  border-radius: 8px;
  cursor: crosshair;
  touch-action: none;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.05);
}
.signature-pad.signed {
  border-color: #8ba871;
  background: #fbfff5;
}
.signature-clear {
  margin-top: 10px;
  padding: 8px 16px;
  background: #f0ede4;
  color: #2d4a2b;
  border: 1px solid #d4c9a8;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}
.signature-clear:hover {
  background: #c85450;
  color: #fff;
  border-color: #c85450;
}
