/* ============================================================
   NOUVELAGE® × BEKKY BARBER — SHARED THEME
   Brand-aligned: editorial luxury, warm browns, cream canvas.
   60/30/10 colour discipline · sharp editorial corners ·
   hairline borders · solid pill buttons · no gradients on UI.
   Loaded after colors_and_type.css (design-system tokens).
   ============================================================ */

/* Arabic faces for RTL */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&family=Amiri:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --font-ar-sans: 'Tajawal', 'Manrope', sans-serif;
  --font-ar-display: 'Amiri', 'Cormorant Garamond', serif;
  --maxw-page: 600px;
}

/* ------------------------------------------------------------
   RESET / BASE
   ------------------------------------------------------------ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  position: relative;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--type-body-size);
  line-height: var(--type-body-lh);
  color: var(--color-text);
  background: var(--color-cream);
  overflow-x: hidden;
  padding:
    env(safe-area-inset-top)
    env(safe-area-inset-right)
    env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}

/* Subtle paper-grain warmth — invisible alone, warm at full-page scale */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.04;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--color-caramel); color: var(--color-cream); }

img { max-width: 100%; }

/* ------------------------------------------------------------
   PAGE SHELL
   ------------------------------------------------------------ */
.n-page {
  position: relative;
  z-index: 1;
  max-width: var(--maxw-page);
  margin: 0 auto;
  padding: clamp(28px, 7vw, 56px) clamp(20px, 5vw, 36px) clamp(48px, 10vh, 80px);
}
.n-page--center {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ------------------------------------------------------------
   BRAND LOCKUP HEADER — Nouvelage × Bekky on every page
   ------------------------------------------------------------ */
.n-header {
  text-align: center;
  margin-bottom: clamp(28px, 6vh, 44px);
  animation: n-rise 0.7s var(--ease-out) both;
}
.n-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 4vw, 28px);
  direction: ltr; /* keep Nouvelage-first lockup order in both languages */
}
.n-lockup img { display: block; height: auto; }
.n-logo-nv { width: clamp(116px, 26vw, 158px); }
.n-logo-bk { width: clamp(92px, 21vw, 124px); }
.n-lockup-x {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(20px, 5vw, 26px);
  color: var(--color-caramel);
  opacity: 0.55;
  line-height: 1;
}
.n-header-eyebrow {
  margin-top: 16px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--color-caramel);
}
.n-divider {
  width: 48px;
  height: 1px;
  margin: 14px auto 0;
  background: linear-gradient(90deg, transparent, rgba(158,110,74,0.5), transparent);
}

/* ------------------------------------------------------------
   TYPOGRAPHY HELPERS
   ------------------------------------------------------------ */
.n-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--color-caramel);
}
.n-eyebrow--rule::before,
.n-eyebrow--rule::after {
  content: '';
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-caramel));
}
.n-eyebrow--rule::after { background: linear-gradient(90deg, var(--color-caramel), transparent); }

.n-display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--color-espresso);
}
.n-serif {
  font-family: var(--font-serif);
  color: var(--color-espresso);
}
.n-serif-italic { font-family: var(--font-serif); font-style: italic; font-weight: 500; color: var(--color-espresso); }
.n-accent { color: var(--color-caramel); }
.n-accent-italic { color: var(--color-caramel); font-style: italic; font-family: var(--font-serif); }

.n-lead {
  font-family: var(--font-sans);
  font-size: clamp(14px, 2.6vw, 16px);
  line-height: 1.6;
  color: var(--color-muted);
}
.n-tagline {
  font-family: var(--font-script);
  font-size: clamp(30px, 6.5vw, 44px);
  line-height: 1;
  color: var(--color-caramel);
  opacity: 0.85;
}

/* ------------------------------------------------------------
   BUTTONS — solid pills, no gradients
   ------------------------------------------------------------ */
.n-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 16px 34px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out);
}
.n-btn svg { width: 16px; height: 16px; transition: transform var(--dur-base) var(--ease-out); }
.n-btn--block { width: 100%; }

.n-btn--primary { background: var(--color-espresso); color: var(--color-cream); }
.n-btn--primary:hover { background: var(--color-ink); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.n-btn--primary:hover svg { transform: translateX(3px); }

.n-btn--brand { background: var(--color-caramel); color: var(--color-cream); }
.n-btn--brand:hover { background: var(--color-bark); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.n-btn--brand:hover svg { transform: translateX(3px); }

.n-btn--ghost { background: transparent; color: var(--color-espresso); border-color: var(--border-strong); }
.n-btn--ghost:hover { border-color: var(--color-espresso); background: rgba(88,56,44,0.04); }

.n-btn--wa { background: #1FA855; color: #fff; }
.n-btn--wa:hover { background: #18914a; transform: translateY(-2px); box-shadow: var(--shadow-md); }

.n-btn--cream { background: var(--color-cream); color: var(--color-espresso); }
.n-btn--cream:hover { background: #fff; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.n-btn--cream:hover svg { transform: translateX(3px); }

/* logos reversed to cream on dark surfaces */
.n-logo--light { filter: brightness(0) invert(1); }
.n-lockup.on-dark img { filter: brightness(0) invert(1); }

.n-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.n-btn:active:not(:disabled) { transform: translateY(0); }
.n-btn:focus-visible { outline: 2px solid var(--color-caramel); outline-offset: 4px; }

/* ------------------------------------------------------------
   BACK LINK
   ------------------------------------------------------------ */
.n-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-default);
  background: var(--color-white);
  color: var(--color-espresso);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-decoration: none;
  transition: all var(--dur-base) var(--ease-out);
  margin-bottom: clamp(24px, 5vh, 36px);
}
.n-back:hover { border-color: var(--color-caramel); color: var(--color-caramel); }
.n-back svg { width: 13px; height: 13px; }
html[dir="rtl"] .n-back svg { transform: scaleX(-1); }

/* ------------------------------------------------------------
   CARD
   ------------------------------------------------------------ */
.n-card {
  background: var(--color-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: clamp(26px, 6vw, 40px);
  box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------------
   STEP PROGRESS
   ------------------------------------------------------------ */
.n-step {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  color: var(--color-caramel);
}

/* ------------------------------------------------------------
   BADGE / PILL
   ------------------------------------------------------------ */
.n-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-default);
  background: var(--color-white);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-caramel);
}
.n-pill--solid { background: var(--color-espresso); color: var(--color-cream); border-color: transparent; }

/* ------------------------------------------------------------
   FORM FIELDS
   ------------------------------------------------------------ */
.n-field { display: flex; flex-direction: column; gap: 9px; }
.n-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-espresso);
}
.n-label .req { color: var(--color-accent); margin-inline-start: 3px; }
.n-input, .n-select {
  width: 100%;
  min-height: 54px;
  padding: 15px 16px;
  font-family: var(--font-sans);
  font-size: 16px;               /* >=16 prevents iOS zoom */
  color: var(--color-espresso);
  background: var(--color-white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.n-input::placeholder { color: var(--color-muted); opacity: 0.7; }
.n-input:focus, .n-select:focus {
  outline: none;
  border-color: var(--color-caramel);
  box-shadow: 0 0 0 3px rgba(158,110,74,0.12);
}
.n-input:read-only { background: var(--color-sand); color: var(--color-muted); cursor: not-allowed; }
.n-field.invalid .n-input { border-color: var(--color-accent); }
.n-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239E6E4A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 20px;
  padding-right: 44px;
}
html[dir="rtl"] .n-select { background-position: left 14px center; padding-right: 16px; padding-left: 44px; }
.n-hint {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-muted);
}
.n-hint svg { width: 13px; height: 13px; flex-shrink: 0; margin-top: 2px; color: var(--color-caramel); }

/* ------------------------------------------------------------
   MODAL
   ------------------------------------------------------------ */
.n-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 28px);
  background: rgba(42, 33, 27, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}
.n-modal-overlay.is-open { display: flex; opacity: 1; }
.n-modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--color-cream);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: clamp(28px, 6vw, 44px);
  box-shadow: var(--shadow-xl);
  transform: translateY(18px);
  transition: transform var(--dur-base) var(--ease-out);
}
.n-modal-overlay.is-open .n-modal { transform: translateY(0); }
.n-modal-close {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-default);
  background: var(--color-white);
  color: var(--color-espresso);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-base) var(--ease-out);
}
.n-modal-close:hover { border-color: var(--color-caramel); color: var(--color-caramel); }
.n-modal-close svg { width: 18px; height: 18px; }
.n-modal::-webkit-scrollbar { width: 8px; }
.n-modal::-webkit-scrollbar-thumb { background: var(--color-caramel); border-radius: 10px; }

/* ------------------------------------------------------------
   LANGUAGE TOGGLE
   ------------------------------------------------------------ */
.n-lang {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  inset-inline-end: max(14px, env(safe-area-inset-right));
  z-index: 1200;
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-default);
  background: rgba(252, 245, 240, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-xs);
}
.n-lang button {
  min-width: 44px;
  min-height: 34px;
  padding: 0 12px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-out);
}
.n-lang button[aria-pressed="true"] { background: var(--color-espresso); color: var(--color-cream); }
.n-lang button:last-child { font-family: var(--font-ar-sans); }

/* ------------------------------------------------------------
   ENTRANCE ANIMATION
   ------------------------------------------------------------ */
@keyframes n-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.n-reveal { opacity: 0; animation: n-rise 0.7s var(--ease-out) forwards; }
.n-reveal-1 { animation-delay: 0.08s; }
.n-reveal-2 { animation-delay: 0.16s; }
.n-reveal-3 { animation-delay: 0.24s; }
.n-reveal-4 { animation-delay: 0.32s; }

/* ------------------------------------------------------------
   RTL + ARABIC TYPE
   ------------------------------------------------------------ */
html[dir="rtl"] body { font-family: var(--font-ar-sans); letter-spacing: 0; }
html[dir="rtl"] .n-display,
html[dir="rtl"] .n-serif,
html[dir="rtl"] .n-serif-italic,
html[dir="rtl"] .n-accent-italic { font-family: var(--font-ar-display); font-style: normal; }
html[dir="rtl"] .n-tagline { font-family: var(--font-ar-display); font-style: italic; }
html[dir="rtl"] .n-eyebrow,
html[dir="rtl"] .n-header-eyebrow,
html[dir="rtl"] .n-step,
html[dir="rtl"] .n-label,
html[dir="rtl"] .n-btn,
html[dir="rtl"] .n-pill,
html[dir="rtl"] .n-back { letter-spacing: 0; }
/* hide the EN/AR-only text variants */
[data-lang-ar] { display: none; }
html[dir="rtl"] [data-lang-en] { display: none; }
html[dir="rtl"] [data-lang-ar] { display: revert; }

/* ------------------------------------------------------------
   ACCESSIBILITY
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
@media (hover: none) and (pointer: coarse) {
  .n-btn, .n-back, .n-modal-close { min-height: 48px; }
}

/* ------------------------------------------------------------
   ELEVATED DARK HEADER BAND — flow pages (registration,
   payment-*, friend-gift). Full-bleed espresso with the
   collaboration lockup reversed to cream + a gold divider.
   ------------------------------------------------------------ */
.n-page { position: relative; }
.n-header {
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  margin-top: calc(-1 * clamp(28px, 7vw, 56px));
  margin-bottom: clamp(30px, 6vh, 48px);
  padding: clamp(60px, 14vw, 88px) clamp(20px, 5vw, 36px) clamp(30px, 7vw, 44px);
  background:
    radial-gradient(130% 80% at 50% -20%, rgba(214,191,148,0.16), transparent 60%),
    linear-gradient(168deg, #5b3a2c 0%, var(--color-espresso) 52%, #3d251c 100%);
  overflow: hidden;
}
.n-header .n-lockup img { filter: brightness(0) invert(1); }
.n-header .n-lockup-x { color: var(--color-peach); opacity: 0.6; }
.n-header .n-divider { width: 60px; margin-top: 16px; background: linear-gradient(90deg, transparent, var(--color-gold), transparent); }
.n-header-eyebrow { color: var(--color-gold-light); }

/* back link floats over the dark band */
.n-back {
  position: absolute;
  top: clamp(16px, 4.5vw, 24px);
  inset-inline-start: clamp(16px, 5vw, 28px);
  z-index: 5;
  margin: 0;
  background: rgba(252,245,240,0.10);
  border-color: rgba(252,245,240,0.32);
  color: var(--color-cream);
}
.n-back:hover { background: rgba(252,245,240,0.20); border-color: var(--color-cream); color: var(--color-cream); }
.n-back:focus-visible { outline: 2px solid var(--color-gold-light); outline-offset: 3px; }
