/* =========================================================
   AlQady Wellbeing — shared design tokens
   Every page (public link page + admin dashboard) reads
   spacing, type, colour, radius, shadow and motion from here.
   ========================================================= */

:root {
  color-scheme: light;

  /* palette — warm paper, forest ink, one terracotta accent */
  --cream: #f7f4ed;
  --cream-light: #fbf9f3;
  --cream-deep: #f1ede2;
  --paper: #fffdf9;
  --white: #ffffff;

  --forest: #2f4a3b;
  --forest-light: #33513f;
  --forest-deep: #24392e;

  --sage: #e6eadb;
  --sage-soft: #eef1e6;
  --sage-deep: #e9ecdf;

  --terracotta: #bc6440;
  --danger: #a13b2a;

  --ink: #2a2a26;
  --muted: #6f6a5f;
  --muted-soft: #8b8578;

  --line: #e2dccd;
  --line-strong: #d3ccb9;
  --line-sage: #d6ddca;

  --on-dark: #fbf9f3;
  --on-dark-soft: rgba(251, 249, 243, 0.72);
  --on-dark-faint: rgba(251, 249, 243, 0.65);

  --forest-a08: rgba(47, 74, 59, 0.08);
  --forest-a10: rgba(47, 74, 59, 0.1);
  --forest-a25: rgba(47, 74, 59, 0.25);
  --forest-a55: rgba(47, 74, 59, 0.55);
  --scrim: rgba(36, 57, 46, 0.45);

  /* type */
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, "Segoe UI", sans-serif;
  --arabic: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;

  --text-2xs: 11px;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-md: 14px;
  --text-lg: 15px;
  --text-xl: 18px;
  --text-2xl: 20px;
  --text-3xl: 28px;

  --leading-tight: 1.15;
  --leading-snug: 1.45;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  --tracking-label: 0.08em;
  --tracking-meta: 0.03em;
  --tracking-caps: 0.2em;
  --tracking-tight: -0.01em;

  --weight-medium: 500;
  --weight-semibold: 600;

  /* spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;

  --gutter: clamp(14px, 4vw, 40px);
  --gap-stack: clamp(16px, 4vw, 24px);
  --gap-block: clamp(20px, 5vw, 32px);
  --gap-section: clamp(24px, 5vw, 32px);

  /* radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-pill: 999px;

  /* elevation */
  --shadow-card: 0 1px 2px rgba(47, 74, 59, 0.06), 0 12px 28px -18px rgba(47, 74, 59, 0.35);
  --shadow-sheet: 0 30px 70px -50px rgba(47, 74, 59, 0.6), 0 2px 0 rgba(255, 255, 255, 0.8) inset;
  --shadow-primary: 0 18px 30px -22px rgba(36, 57, 46, 0.9);
  --shadow-primary-hover: 0 22px 36px -20px rgba(36, 57, 46, 0.85);
  --shadow-modal: 0 40px 80px -40px rgba(20, 35, 27, 0.7);

  /* motion */
  --ease: cubic-bezier(0.22, 0.68, 0.32, 1);
  --dur-fast: 0.2s;
  --dur: 0.25s;
  --dur-slow: 0.3s;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
  background: radial-gradient(120% 90% at 50% 0%, var(--cream-light) 0%, var(--cream) 55%, var(--cream-deep) 100%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: radial-gradient(rgba(47, 74, 59, 0.09) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
  mix-blend-mode: multiply;
}

.sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: clamp(22px, 5vw, 40px);
  box-shadow: var(--shadow-sheet);
  animation: rise 0.7s var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- announcement strip ---------- */

.notice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3);
  margin-bottom: var(--gap-stack);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--sage-soft) 0%, var(--sage-deep) 100%);
  border: 1px solid var(--line-sage);
  color: var(--forest);
  transition: opacity var(--dur-slow) ease, transform var(--dur-slow) ease;
}

.notice[hidden] {
  display: none;
}

.notice.is-hiding {
  opacity: 0;
  transform: translateY(-6px);
}

.notice__dot {
  flex: none;
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--terracotta);
  animation: pulse 2.6s ease-out infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(188, 100, 64, 0.45);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(188, 100, 64, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(188, 100, 64, 0);
  }
}

.notice__text {
  flex: 1;
  margin: 0;
  font-size: var(--text-xs);
  line-height: var(--leading-snug);
  letter-spacing: 0.005em;
}

.notice__close {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-top: -2px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--forest-a55);
  cursor: pointer;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}

.notice__close:hover {
  background: var(--forest-a08);
  color: var(--forest);
}

.notice__close svg {
  width: 14px;
  height: 14px;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--gap-block);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.monogram {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--forest);
  color: var(--forest);
  font-family: var(--serif);
  font-size: var(--text-xl);
  font-weight: var(--weight-medium);
  letter-spacing: 0.02em;
}

.wordmark {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  letter-spacing: 0.01em;
  color: var(--forest);
}

.lang {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--forest);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--dur) ease, border-color var(--dur) ease, transform var(--dur) ease;
}

.lang:hover {
  background: var(--sage);
  border-color: transparent;
}

.lang:active {
  transform: scale(0.97);
}

/* ---------- hero ---------- */

.hero {
  text-align: center;
}

.arch-frame {
  position: relative;
  height: clamp(180px, 42vw, 250px);
  border-radius: var(--radius-pill) var(--radius-pill) 0 0;
  background: linear-gradient(180deg, var(--sage) 0%, var(--sage-deep) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  margin-bottom: var(--gap-block);
}

.sun {
  position: absolute;
  bottom: 128px;
  left: 50%;
  width: 54px;
  height: 54px;
  margin-left: -27px;
  border-radius: 50%;
  background: var(--terracotta);
  animation: breathe 9s ease-in-out infinite;
}

.arch {
  position: relative;
  width: 104px;
  height: 148px;
  border: 17px solid var(--forest);
  border-bottom: none;
  border-radius: 60px 60px 0 0;
}

@keyframes breathe {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.eyebrow {
  margin: 0 0 var(--space-2);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--terracotta);
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: var(--weight-medium);
  font-size: clamp(38px, 9vw, 54px);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--forest-deep);
}

.tagline {
  margin: var(--space-3) auto 0;
  max-width: 30ch;
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  color: var(--muted);
}

.where {
  margin: var(--space-3) 0 var(--gap-block);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-meta);
  color: var(--muted-soft);
}

/* ---------- link cards ---------- */

.links {
  display: grid;
  gap: var(--space-3);
}

.card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  transition: transform var(--dur) ease, box-shadow var(--dur) ease, border-color var(--dur) ease,
    background var(--dur) ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card);
}

.card--primary {
  background: linear-gradient(180deg, var(--forest-light) 0%, var(--forest-deep) 100%);
  border-color: transparent;
  color: var(--on-dark);
  box-shadow: var(--shadow-primary);
}

.card--primary:hover {
  box-shadow: var(--shadow-primary-hover);
}

.card__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.card__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.005em;
  line-height: var(--leading-snug);
}

.card--primary .card__title {
  font-weight: var(--weight-medium);
}

.card__desc {
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--muted);
}

.card--primary .card__desc {
  color: var(--on-dark-soft);
}

.card__arrow {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--forest);
  transition: transform var(--dur) ease;
}

.card--primary .card__arrow {
  color: var(--on-dark);
}

.card:hover .card__arrow {
  transform: translate(2px, -2px);
}

.card__arrow svg {
  width: 18px;
  height: 18px;
}

/* ---------- disclaimer + footer ---------- */

.disclaimer {
  margin: var(--gap-section) auto 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  font-size: var(--text-xs);
  line-height: var(--leading-relaxed);
  text-align: center;
  color: var(--muted-soft);
  max-width: 42ch;
}

.foot {
  margin-top: var(--space-4);
  text-align: center;
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-meta);
  color: var(--muted-soft);
}

/* ---------- arabic (RTL) ---------- */

html[dir="rtl"] body {
  font-family: var(--arabic);
}

/* Arabic script needs a slightly smaller display size than Cormorant at the same scale. */
html[dir="rtl"] h1 {
  font-family: var(--arabic);
  font-size: clamp(34px, 8vw, 46px);
}

html[dir="rtl"] .eyebrow {
  letter-spacing: 0.02em;
}

html[dir="rtl"] .tagline {
  line-height: var(--leading-relaxed);
}

html[dir="rtl"] .card__arrow {
  transform: scaleX(-1);
}

html[dir="rtl"] .card:hover .card__arrow {
  transform: scaleX(-1) translate(2px, -2px);
}

html[dir="rtl"] .monogram {
  font-family: var(--sans);
  font-size: var(--text-md);
}

/* ---------- request card ---------- */

.card--request {
  width: 100%;
  font-family: inherit;
  text-align: start;
  cursor: pointer;
  background: linear-gradient(180deg, var(--paper) 0%, var(--sage-soft) 100%);
  border-color: var(--line-sage);
}

.card--request .card__arrow {
  border: 1px solid var(--forest-a25);
  border-radius: 50%;
  width: 26px;
  height: 26px;
}

.card--request .card__arrow svg {
  width: 13px;
  height: 13px;
}

html[dir="rtl"] .card--request {
  text-align: right;
}

/* ---------- request modal ---------- */

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: clamp(10px, 4vw, 32px);
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(3px);
  animation: fade var(--dur) ease both;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.modal__panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 5vw, 32px);
  box-shadow: var(--shadow-modal);
  animation: rise 0.35s var(--ease) both;
}

.modal__close {
  position: absolute;
  inset-inline-end: var(--space-3);
  top: var(--space-3);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}

.modal__close:hover {
  background: var(--sage);
  color: var(--forest);
}

.modal__close svg {
  width: 15px;
  height: 15px;
}

.modal h2 {
  margin: 0 0 var(--space-2);
  font-family: var(--serif);
  font-weight: var(--weight-medium);
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  color: var(--forest-deep);
}

html[dir="rtl"] .modal h2 {
  font-family: var(--arabic);
  font-size: 24px;
}

.modal__intro {
  margin: 0 0 var(--space-4);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  color: var(--muted);
}

/* ---------- form ---------- */

.field {
  display: block;
  margin-bottom: var(--space-3);
}

.field > span {
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--forest);
  letter-spacing: 0.01em;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-family: inherit;
  font-size: var(--text-md);
  line-height: var(--leading-snug);
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.field textarea {
  resize: vertical;
  min-height: 74px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 3px var(--forest-a10);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.check {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  margin: var(--space-4) 0 var(--space-1);
  font-size: var(--text-xs);
  line-height: var(--leading-snug);
  color: var(--muted);
  cursor: pointer;
}

.check input {
  margin-top: 3px;
  accent-color: var(--forest);
  width: 15px;
  height: 15px;
  flex: none;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.form-error {
  margin: var(--space-3) 0 0;
  font-size: var(--text-xs);
  line-height: var(--leading-snug);
  color: var(--danger);
}

.submit {
  display: block;
  width: 100%;
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-5);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--forest);
  color: var(--on-dark);
  font-family: inherit;
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.submit:hover {
  background: var(--forest-deep);
}

.submit:disabled {
  opacity: 0.65;
  cursor: progress;
}

.submit--ghost {
  background: transparent;
  color: var(--forest);
  border: 1px solid var(--forest);
}

.submit--ghost:hover {
  background: var(--sage);
}

.done__mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: var(--space-4);
  border-radius: 50%;
  background: var(--sage);
  color: var(--forest);
}

.done__mark svg {
  width: 22px;
  height: 22px;
}

/* ---------- responsive ---------- */

@media (max-width: 420px) {
  .sheet {
    border-radius: var(--radius-lg);
  }

  .arch-frame {
    height: 190px;
  }

  .sun {
    bottom: 118px;
    width: 46px;
    height: 46px;
    margin-left: -23px;
  }

  .arch {
    width: 92px;
    height: 132px;
    border-width: 15px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
