/* ============================================================================
   منصة شغف — Shaghf Platform
   css/base.css — التصميم المشترك: المتغيرات، الخلفية، الأزرار، الحقول،
   النوافذ المنبثقة، التنبيهات، والواجهات العامة.
   ========================================================================== */

@import url('fonts.css?v=3');

/* ------------------------------------------------------------------ */
/*  1. Design tokens                                                   */
/* ------------------------------------------------------------------ */

:root {
  /* Typography */
  --font-body: 'Tajawal', 'Segoe UI', Tahoma, 'Noto Kufi Arabic', sans-serif;
  --font-display: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
  --font-brand: 'Baloo Bhaijaan 2', 'Tajawal', 'Segoe UI', sans-serif;

  /* Brand */
  --violet: #6d58c9;
  --violet-deep: #4b388f;
  --violet-soft: #f1edfb;
  --pink: #c16183;
  --pink-soft: #fbeef3;
  --sky: #5083a4;
  --sky-soft: #eaf4f9;
  --mint: #5f8f7f;
  --mint-soft: #ebf5f0;
  --amber: #b98a3f;
  --amber-soft: #faf1df;

  /* Ink */
  --ink: #2a2233;
  --ink-soft: #5f586b;
  --ink-faint: #8b8498;

  /* Surfaces */
  --surface: rgba(255, 252, 247, 0.78);
  --surface-strong: rgba(255, 252, 247, 0.95);
  --surface-muted: rgba(250, 246, 240, 0.82);
  --line: rgba(88, 70, 112, 0.12);
  --line-strong: rgba(88, 70, 112, 0.2);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(45, 32, 64, 0.04);
  --shadow-sm: 0 8px 24px -16px rgba(45, 32, 64, 0.18);
  --shadow-md: 0 24px 50px -30px rgba(45, 32, 64, 0.25);
  --shadow-lg: 0 36px 80px -36px rgba(45, 32, 64, 0.35);
  --shadow-glow: 0 14px 40px -18px rgba(109, 88, 201, 0.45);

  /* Radii */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --radius-full: 999px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --speed: 220ms;

  /* Layout */
  --shell: 1200px;
  --header-h: 74px;
  --gutter: clamp(1rem, 2.5vw, 2rem);
}

/* ------------------------------------------------------------------ */
/*  2. Reset & base                                                    */
/* ------------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html:focus-within {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(1200px 800px at 88% -12%, rgba(226, 216, 248, 0.6) 0%, rgba(226, 216, 248, 0) 62%),
    radial-gradient(1000px 700px at -10% 12%, rgba(250, 226, 236, 0.55) 0%, rgba(250, 226, 236, 0) 60%),
    radial-gradient(1100px 800px at 50% 112%, rgba(248, 235, 208, 0.5) 0%, rgba(248, 235, 208, 0) 65%),
    linear-gradient(180deg, #fcfaf6 0%, #f8f5fb 50%, #fbf8f1 100%);
  background-attachment: fixed;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.has-modal {
  overflow: hidden;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: var(--violet-deep);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

ul,
ol {
  list-style: none;
}

::selection {
  background: rgba(124, 92, 255, 0.22);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid rgba(124, 92, 255, 0.5);
  outline-offset: 3px;
  border-radius: 8px;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
}

/* Custom scrollbar (WebKit) */
::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(124, 92, 255, 0.24);
  border: 3px solid transparent;
  border-radius: 99px;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(124, 92, 255, 0.4);
  border: 3px solid transparent;
  background-clip: content-box;
}

/* ------------------------------------------------------------------ */
/*  3. Ambient background blobs                                        */
/* ------------------------------------------------------------------ */

.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.42;
  will-change: transform;
}

.blob--1 {
  width: 44vmax;
  height: 44vmax;
  top: -14vmax;
  inset-inline-end: -10vmax;
  background: radial-gradient(circle at 35% 35%, #d9ccf4, #ece2fb 65%, transparent 72%);
  animation: blob-float-a 24s var(--ease) infinite alternate;
}

.blob--2 {
  width: 36vmax;
  height: 36vmax;
  top: 22vh;
  inset-inline-start: -14vmax;
  background: radial-gradient(circle at 40% 40%, #f5d4e3, #fbe8f1 60%, transparent 72%);
  animation: blob-float-b 28s var(--ease) infinite alternate;
}

.blob--3 {
  width: 40vmax;
  height: 40vmax;
  bottom: -18vmax;
  inset-inline-start: 22vw;
  background: radial-gradient(circle at 45% 45%, #efe2c7, #f8efd9 62%, transparent 74%);
  animation: blob-float-c 32s var(--ease) infinite alternate;
}

@keyframes blob-float-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-4vmax, 3vmax, 0) scale(1.08); }
}

@keyframes blob-float-b {
  from { transform: translate3d(0, 0, 0) scale(1.05); }
  to { transform: translate3d(5vmax, -3vmax, 0) scale(0.95); }
}

@keyframes blob-float-c {
  from { transform: translate3d(0, 0, 0) scale(0.98); }
  to { transform: translate3d(3vmax, -4vmax, 0) scale(1.1); }
}

/* ------------------------------------------------------------------ */
/*  4. Layout helpers                                                  */
/* ------------------------------------------------------------------ */

.shell {
  width: min(var(--shell), 100% - (var(--gutter) * 2));
  margin-inline: auto;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  inset-inline-start: 0.75rem;
  z-index: 200;
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius-full);
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform var(--speed) var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
  text-decoration: none;
}

.is-hidden {
  display: none !important;
}

.muted {
  color: var(--ink-soft);
}

.text-center {
  text-align: center;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.divider {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
  margin-block: 1.1rem;
}

/* ------------------------------------------------------------------ */
/*  5. Glass surfaces                                                  */
/* ------------------------------------------------------------------ */

.glass {
  position: relative;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.62));
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  backdrop-filter: blur(20px) saturate(1.2);
}

.glass--soft {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.7), rgba(252, 249, 255, 0.55));
  border-color: rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------------------ */
/*  6. Typography utilities                                            */
/* ------------------------------------------------------------------ */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--violet-deep);
}

.gradient-text {
  background: linear-gradient(120deg, #6d28d9 0%, #db2777 45%, #0284c7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.lead {
  font-size: clamp(0.98rem, 1.4vw, 1.12rem);
  color: var(--ink-soft);
  line-height: 1.9;
}

.display {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

/* ------------------------------------------------------------------ */
/*  7. Buttons                                                         */
/* ------------------------------------------------------------------ */

.btn {
  --btn-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.68rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.94rem;
  line-height: 1;
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  box-shadow: var(--btn-shadow);
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease),
    background-color var(--speed) var(--ease), color var(--speed) var(--ease),
    border-color var(--speed) var(--ease), opacity var(--speed) var(--ease);
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0) scale(0.985);
}

.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn--primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d5cf6 48%, #4f8ef7 100%);
  color: #fff;
  --btn-shadow: 0 14px 28px -14px rgba(109, 92, 246, 0.75);
}

.btn--primary:hover {
  box-shadow: 0 18px 34px -14px rgba(109, 92, 246, 0.85);
}

.btn--soft {
  background: #f1ecff;
  border-color: rgba(124, 92, 255, 0.16);
  color: var(--violet-deep);
}

.btn--soft:hover {
  background: #e8e0ff;
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.6);
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.btn--ghost:hover {
  background: #fff;
  color: var(--ink);
  border-color: rgba(124, 92, 255, 0.38);
}

.btn--danger {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}

.btn--danger:hover {
  background: #ffe4e6;
}

.btn--danger-solid {
  background: linear-gradient(135deg, #e11d48, #be123c);
  color: #fff;
  --btn-shadow: 0 14px 28px -14px rgba(225, 29, 72, 0.65);
}

.btn--sm {
  min-height: 36px;
  padding: 0.45rem 0.9rem;
  font-size: 0.84rem;
}

.btn--lg {
  min-height: 54px;
  padding: 0.9rem 1.75rem;
  font-size: 1.02rem;
}

.btn--block {
  width: 100%;
}

.btn--icon {
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: var(--radius-full);
}

.btn--icon.btn--sm {
  width: 36px;
  min-height: 36px;
}

/* أزرار مرحة بارزة (مناسبة للأطفال) */
.btn {
  border-radius: var(--radius-full);
  box-shadow: 0 4px 0 rgba(76, 29, 149, 0.14), 0 10px 20px -14px rgba(76, 29, 149, 0.35);
}

.btn:hover {
  box-shadow: 0 6px 0 rgba(76, 29, 149, 0.14), 0 16px 26px -16px rgba(76, 29, 149, 0.4);
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(76, 29, 149, 0.14);
}

.btn--primary {
  box-shadow: 0 5px 0 #5b21b6, 0 16px 30px -16px rgba(124, 92, 255, 0.85);
}

.btn--primary:hover {
  box-shadow: 0 7px 0 #5b21b6, 0 20px 34px -16px rgba(124, 92, 255, 0.9);
}

.btn--soft,
.btn--ghost,
.btn--danger {
  box-shadow: 0 4px 0 rgba(124, 92, 255, 0.14), 0 10px 18px -14px rgba(76, 29, 149, 0.3);
}

.btn--danger {
  box-shadow: 0 4px 0 rgba(190, 18, 60, 0.14), 0 10px 18px -14px rgba(190, 18, 60, 0.3);
}

.btn .btn__spinner {
  width: 1em;
  height: 1em;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  color: var(--ink-soft);
  font-size: 1.15rem;
  line-height: 1;
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease),
    transform var(--speed) var(--ease), border-color var(--speed) var(--ease);
}

.icon-btn:hover {
  background: rgba(124, 92, 255, 0.09);
  color: var(--violet-deep);
  transform: translateY(-1px);
}

.icon-btn--danger:hover {
  background: #fff1f2;
  color: #be123c;
}

/* ------------------------------------------------------------------ */
/*  8. Form controls                                                   */
/* ------------------------------------------------------------------ */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.field__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

.field__label .optional {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-faint);
}

.field__hint {
  font-size: 0.77rem;
  color: var(--ink-faint);
  line-height: 1.6;
}

.field__error {
  font-size: 0.8rem;
  font-weight: 700;
  color: #be123c;
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 46px;
  padding: 0.68rem 0.95rem;
  border: 1.5px solid rgba(124, 92, 255, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.82);
  font-family: var(--font-body);
  font-size: 0.96rem;
  font-weight: 500;
  color: var(--ink);
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease),
    background-color var(--speed) var(--ease);
}

.input::placeholder,
.textarea::placeholder {
  color: #b3adc4;
  font-weight: 400;
}

.input:hover,
.textarea:hover,
.select:hover {
  border-color: rgba(124, 92, 255, 0.32);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: #a78bfa;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.14);
}

.input.is-invalid,
.textarea.is-invalid,
.select.is-invalid {
  border-color: #fb7185;
  box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.12);
}

.textarea {
  min-height: 118px;
  line-height: 1.85;
  resize: vertical;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.5 7 7.5 13 1.5' fill='none' stroke='%237c5cff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.95rem center;
  background-size: 13px 8px;
  cursor: pointer;
}

/* checkbox / radio */
.check {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--violet);
  cursor: pointer;
}

/* Character counter */
.counter {
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
}

.counter.is-near {
  color: #b45309;
  font-weight: 700;
}

.counter.is-over {
  color: #be123c;
  font-weight: 700;
}

/* ------------------------------------------------------------------ */
/*  9. Badges, chips, tags                                             */
/* ------------------------------------------------------------------ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.62rem;
  border-radius: var(--radius-full);
  background: rgba(124, 92, 255, 0.1);
  color: var(--violet-deep);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}

.badge--muted {
  background: rgba(43, 36, 64, 0.06);
  color: var(--ink-soft);
}

.badge--success {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.badge--amber {
  background: rgba(245, 158, 11, 0.14);
  color: #92400e;
}

/* شارة صغيرة مرحة للصفحة الرئيسية */
.kids-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.95rem;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #fff4c9 0%, #ffe3f3 100%);
  box-shadow: 0 6px 16px -10px rgba(236, 72, 153, 0.5), inset 0 1px 0 #fff;
  color: #9d174d;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.5;
  white-space: nowrap;
  transform: rotate(-1.5deg);
}

.kids-badge__emoji {
  font-size: 1.05rem;
  line-height: 1;
  animation: badge-bounce 2.8s var(--ease) infinite;
}

@keyframes badge-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  45% { transform: translateY(-3px) rotate(-8deg); }
  65% { transform: translateY(0) rotate(4deg); }
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 38px;
  padding: 0.35rem 0.85rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--speed) var(--ease);
}

.chip:hover {
  border-color: rgba(124, 92, 255, 0.38);
  color: var(--ink);
}

.chip.is-active {
  background: #f1ecff;
  border-color: rgba(124, 92, 255, 0.5);
  color: var(--violet-deep);
  box-shadow: 0 4px 14px -8px rgba(124, 92, 255, 0.6);
}

/* ------------------------------------------------------------------ */
/*  10. Modal / dialog                                                 */
/* ------------------------------------------------------------------ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(43, 36, 64, 0.4);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  opacity: 0;
  transition: opacity 300ms var(--ease);
}

.modal__panel {
  position: relative;
  z-index: 1;
  width: min(540px, 100%);
  max-height: min(88vh, 860px);
  max-height: min(88svh, 860px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.97), rgba(253, 250, 255, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  transition: opacity 300ms var(--ease), transform 300ms var(--ease-bounce);
}

.modal.is-open .modal__backdrop {
  opacity: 1;
}

.modal.is-open .modal__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.5rem 0.35rem;
}

.modal__title {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 800;
  color: var(--ink);
}

.modal__subtitle {
  margin-top: 0.2rem;
  font-size: 0.84rem;
  color: var(--ink-soft);
}

.modal__close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(43, 36, 64, 0.06);
  color: var(--ink-soft);
  font-size: 1.05rem;
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease),
    transform var(--speed) var(--ease);
}

.modal__close:hover {
  background: #ffe4e6;
  color: #be123c;
  transform: rotate(90deg);
}

.modal__body {
  padding: 0.55rem 1.5rem 1.1rem;
}

.modal__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
  padding: 0.4rem 1.5rem 1.5rem;
}

.modal--wide .modal__panel {
  width: min(680px, 100%);
}

.modal--confirm .modal__panel {
  width: min(430px, 100%);
}

.confirm__icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #fff1f2;
  color: #e11d48;
  font-size: 1.6rem;
  margin-inline: auto;
}

.confirm__body {
  padding: 1.2rem 1.5rem 0.4rem;
  text-align: center;
}

.confirm__title {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.confirm__text {
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.9;
}

.confirm__footer {
  justify-content: center;
  padding-top: 1.15rem;
}

/* ------------------------------------------------------------------ */
/*  11. Toasts                                                         */
/* ------------------------------------------------------------------ */

.toast-stack {
  position: fixed;
  inset-inline: 0;
  bottom: max(1.1rem, env(safe-area-inset-bottom));
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding-inline: 1rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  max-width: min(460px, 100%);
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius-full);
  background: var(--ink);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.5;
  box-shadow: 0 18px 40px -18px rgba(43, 36, 64, 0.6);
  pointer-events: auto;
  animation: toast-in 380ms var(--ease-bounce) both;
}

.toast--success {
  background: linear-gradient(135deg, #059669, #10b981);
}

.toast--error {
  background: linear-gradient(135deg, #be123c, #e11d48);
}

.toast--info {
  background: linear-gradient(135deg, #4f46e5, #7c5cff);
}

.toast__icon {
  font-size: 1.05rem;
  line-height: 1;
}

.toast.is-leaving {
  animation: toast-out 240ms var(--ease) forwards;
}

/* ------------------------------------------------------------------ */
/*  12. Empty states                                                   */
/* ------------------------------------------------------------------ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2.6rem 1.5rem;
  text-align: center;
  border: 1.5px dashed rgba(124, 92, 255, 0.24);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.45);
}

.empty-state__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 0.25rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #f1ecff, #fde8f2);
  font-size: 1.7rem;
}

.empty-state__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
}

.empty-state__text {
  max-width: 38ch;
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.8;
}

/* ------------------------------------------------------------------ */
/*  13. Animations                                                     */
/* ------------------------------------------------------------------ */

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(14px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(10px) scale(0.96); }
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

.animate-pop {
  animation: pop-in 420ms var(--ease-bounce) both;
}

.is-shaking {
  animation: shake 420ms var(--ease) both;
}

/* ------------------------------------------------------------------ */
/*  14. Responsive & accessibility                                     */
/* ------------------------------------------------------------------ */

@media (max-width: 560px) {
  :root {
    --gutter: 1rem;
    --radius-lg: 22px;
  }

  .modal__header,
  .modal__body {
    padding-inline: 1.15rem;
  }

  .modal__footer {
    padding-inline: 1.15rem;
  }

  .btn {
    padding-inline: 1.05rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .blob {
    animation: none !important;
  }
}

/* ==================================================================== */
/*  Premium design layer (v4)                                           */
/*  Refined surfaces, typography and controls shared by all pages.      */
/* ==================================================================== */

::selection {
  background: rgba(109, 88, 201, 0.18);
  color: var(--ink);
}

h1,
h2,
h3,
h4 {
  letter-spacing: -0.012em;
  font-weight: 800;
}

.glass {
  background: linear-gradient(162deg, rgba(255, 253, 248, 0.9), rgba(251, 247, 242, 0.74));
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -38px rgba(45, 32, 64, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  backdrop-filter: blur(18px) saturate(1.1);
}

.btn {
  min-height: 44px;
  padding: 0.65rem 1.2rem;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  box-shadow: 0 8px 20px -16px rgba(45, 32, 64, 0.4);
  font-weight: 700;
  letter-spacing: 0;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -18px rgba(45, 32, 64, 0.42);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px -10px rgba(45, 32, 64, 0.35);
}

.btn--primary {
  background: linear-gradient(135deg, #5a46aa 0%, #7a63cc 55%, #9b6cb8 100%);
  color: #fff;
  box-shadow: 0 14px 30px -18px rgba(90, 70, 170, 0.75);
}

.btn--primary:hover {
  box-shadow: 0 18px 36px -18px rgba(90, 70, 170, 0.8);
}

.btn--soft {
  background: #f4efe8;
  border-color: rgba(88, 70, 112, 0.12);
  color: var(--violet-deep);
  box-shadow: none;
}

.btn--soft:hover {
  background: #f0e9e1;
  box-shadow: 0 10px 22px -18px rgba(45, 32, 64, 0.35);
}

.btn--ghost {
  background: rgba(255, 252, 247, 0.72);
  border-color: rgba(88, 70, 112, 0.15);
  color: var(--ink-soft);
  box-shadow: none;
}

.btn--ghost:hover {
  background: #fffdf9;
  border-color: rgba(88, 70, 112, 0.28);
  color: var(--ink);
  box-shadow: 0 10px 22px -18px rgba(45, 32, 64, 0.35);
}

.btn--danger {
  background: #fbebef;
  border-color: #f2ccd6;
  color: #9f3552;
  box-shadow: none;
}

.btn--danger-solid {
  background: linear-gradient(135deg, #b34560, #8f2d47);
  color: #fff;
  box-shadow: 0 14px 28px -18px rgba(143, 45, 71, 0.65);
}

.btn--sm {
  min-height: 38px;
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
}

.btn--lg {
  min-height: 54px;
  padding: 0.85rem 1.6rem;
  font-size: 1rem;
}

.icon-btn {
  border-radius: 50%;
  color: var(--ink-faint);
}

.icon-btn:hover {
  background: rgba(109, 88, 201, 0.08);
  color: var(--violet-deep);
  transform: none;
}

.input,
.textarea,
.select {
  min-height: 48px;
  border: 1px solid rgba(88, 70, 112, 0.18);
  border-radius: var(--radius-sm);
  background: #fffdf9;
  font-size: 0.96rem;
}

.input:hover,
.textarea:hover,
.select:hover {
  border-color: rgba(88, 70, 112, 0.3);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: #a38bd8;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(109, 88, 201, 0.12);
}

.input.is-invalid,
.textarea.is-invalid,
.select.is-invalid {
  border-color: #d98e9f;
  box-shadow: 0 0 0 4px rgba(217, 142, 159, 0.14);
}

.field__label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
}

.field__hint {
  color: var(--ink-faint);
  line-height: 1.65;
}

.badge {
  padding: 0.18rem 0.6rem;
  border: 1px solid rgba(88, 70, 112, 0.08);
  background: #f3eee7;
  color: #6a5587;
  font-weight: 700;
}

.badge--muted {
  background: rgba(88, 70, 112, 0.06);
  color: var(--ink-soft);
}

.badge--success {
  background: #e9f5ef;
  color: #3f725f;
}

.badge--amber {
  background: #faf1df;
  color: #8a6425;
}

.chip {
  border: 1px solid var(--line);
  background: #fffdf9;
  border-radius: var(--radius-full);
}

.chip:hover {
  border-color: rgba(109, 88, 201, 0.35);
}

.chip.is-active {
  background: #f1ecfb;
  border-color: rgba(109, 88, 201, 0.45);
  color: var(--violet-deep);
  box-shadow: 0 8px 18px -14px rgba(109, 88, 201, 0.5);
}

.kids-badge {
  border: 1px solid rgba(185, 138, 63, 0.28);
  background: linear-gradient(135deg, #fff9ec 0%, #fdf1f5 100%);
  box-shadow: 0 8px 20px -16px rgba(80, 50, 30, 0.35);
  color: #7a4d31;
  transform: none;
}

.kids-badge__emoji {
  animation: none;
}

.modal__backdrop {
  background: rgba(30, 22, 42, 0.44);
  -webkit-backdrop-filter: blur(9px) saturate(1.05);
  backdrop-filter: blur(9px) saturate(1.05);
}

.modal__panel {
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-lg);
  background: #fffdf9;
  box-shadow: 0 42px 100px -42px rgba(30, 22, 42, 0.55);
}

.modal__title {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--ink);
}

.modal__subtitle {
  color: var(--ink-soft);
}

.modal__close {
  background: #f4efe8;
  color: var(--ink-soft);
}

.modal__close:hover {
  background: #fbebef;
  color: #9f3552;
  transform: none;
}

.modal__header {
  padding-top: 1.4rem;
}

.modal__footer {
  padding-bottom: 1.4rem;
}

.toast {
  border-radius: 14px;
  background: #2a2233;
  font-weight: 600;
  box-shadow: 0 20px 44px -22px rgba(30, 22, 42, 0.55);
}

.confirm__icon {
  background: #fbebef;
  color: #9f3552;
}

.empty-state {
  border: 1px dashed rgba(88, 70, 112, 0.22);
  border-radius: var(--radius-lg);
  background: rgba(255, 252, 247, 0.55);
}

.empty-state__icon {
  background: linear-gradient(145deg, #f1ecfb, #fdf1f5);
}

::selection {
  background: rgba(109, 88, 201, 0.18);
}

/* Scrollbar refinement */
::-webkit-scrollbar-thumb {
  background: rgba(109, 88, 201, 0.22);
  border: 3px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(109, 88, 201, 0.38);
  border: 3px solid transparent;
  background-clip: content-box;
}
