/* ═══════════════════════════════════════════════════════════════
   InDevent Dashboard — Shared Styles
   Aesthetic: refined Indian wedding card — cream paper, saffron gold,
   Allura script for emotion, Cormorant for headings, Inter for clarity.
   Mobile-first throughout.
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Palette */
  --saffron-100: #FFE9CC;
  --saffron-300: #FFB347;
  --saffron-500: #FF8A00;
  --saffron-700: #E67700;
  --saffron-900: #B85800;
  --gold:        #DCA64F;
  --gold-soft:   #DCA64F33;
  --cream:       #FFF8EE;
  --cream-deep:  #FAEFD9;
  --ink:         #2A1810;
  --ink-soft:    #6B4E3D;
  --ink-faint:   #A38974;
  --rose:        #E08CA0;
  --leaf:        #A4C49A;
  --danger:      #C53030;
  --success:     #2F7D5E;

  /* Type scale */
  --font-display: 'Allura', cursive;
  --font-head:    'Cormorant Garamond', 'Georgia', serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-deva:    'Noto Sans Devanagari', 'Mangal', sans-serif;

  /* Surfaces */
  --shadow-sm: 0 2px 8px rgba(184, 88, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(184, 88, 0, 0.12);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* Spacing */
  --gap-xs: 8px;
  --gap-sm: 12px;
  --gap-md: 20px;
  --gap-lg: 32px;
  --gap-xl: 48px;
}

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(ellipse 800px 600px at 0% 0%,    rgba(255, 179, 71, 0.15)  0%, transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 100%, rgba(230, 119, 0, 0.10)  0%, transparent 60%),
    linear-gradient(160deg, var(--cream) 0%, var(--cream-deep) 100%);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Decorative floral corner motifs */
body::before, body::after {
  content: '';
  position: fixed;
  width: 240px;
  height: 240px;
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}
body::before {
  top: -30px; left: -30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='%23DCA64F' fill-opacity='0.35'%3E%3Ccircle cx='40' cy='40' r='8'/%3E%3Cpath d='M40 20 C50 30 50 50 40 60 C30 50 30 30 40 20 Z'/%3E%3Cpath d='M20 40 C30 30 50 30 60 40 C50 50 30 50 20 40 Z'/%3E%3Cpath d='M70 70 C75 80 85 80 90 70'/%3E%3Cpath d='M100 100 C105 110 115 110 120 100'/%3E%3C/g%3E%3C/svg%3E");
}
body::after {
  bottom: -30px; right: -30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='%23E67700' fill-opacity='0.25'%3E%3Ccircle cx='160' cy='160' r='8'/%3E%3Cpath d='M160 140 C170 150 170 170 160 180 C150 170 150 150 160 140 Z'/%3E%3Cpath d='M140 160 C150 150 170 150 180 160 C170 170 150 170 140 160 Z'/%3E%3C/g%3E%3C/svg%3E");
}

/* ─── Container ─── */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: var(--gap-md);
  display: flex;
  flex-direction: column;
}

.center-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gap-md) 0;
}

/* ─── Brand wordmark ─── */
.brand {
  text-align: center;
  margin-bottom: var(--gap-md);
}
.brand-name {
  font-family: var(--font-display);
  font-size: clamp(48px, 10vw, 72px);
  line-height: 1;
  color: var(--saffron-700);
  text-shadow: 0 2px 16px rgba(184, 88, 0, 0.15);
}
.brand-tag {
  font-family: var(--font-head);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-soft);
  margin-top: 4px;
  letter-spacing: 0.3px;
}

/* ─── Ornamental divider ─── */
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: var(--gap-md) 0;
  opacity: 0.7;
}
.ornament .line {
  width: 56px; height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
}
.ornament .diamond {
  color: var(--gold);
  font-size: 10px;
}

/* ─── Card ─── */
.card {
  background: rgba(255, 248, 238, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gold-soft);
  box-shadow: var(--shadow-lg);
  padding: var(--gap-lg);
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.card h1, .card h2 {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--saffron-900);
  text-align: center;
}
.card h1 { font-size: 28px; margin-bottom: 6px; letter-spacing: -0.3px; }
.card h2 { font-size: 22px; margin-bottom: var(--gap-md); }
.card .subhead {
  text-align: center;
  color: var(--ink-soft);
  font-size: 14.5px;
  margin-bottom: var(--gap-lg);
  line-height: 1.55;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;          /* touch target ≥ 44px + breathing room */
  padding: 0 22px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s ease;
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
  outline: 2px solid var(--saffron-500);
  outline-offset: 3px;
}
.btn[disabled], .btn.is-loading {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--saffron-500), var(--saffron-700));
  color: white;
  box-shadow: 0 6px 18px rgba(230, 119, 0, 0.32);
}
.btn-primary:hover {
  box-shadow: 0 10px 26px rgba(230, 119, 0, 0.42);
  transform: translateY(-1px);
}

.btn-google {
  background: white;
  color: var(--ink);
  border: 1px solid #DADCE0;
  box-shadow: var(--shadow-sm);
}
.btn-google:hover {
  background: #F8F9FA;
  box-shadow: var(--shadow-md);
}
.btn-google svg { flex-shrink: 0; }

.btn-ghost {
  background: transparent;
  color: var(--saffron-700);
  border: 1px solid var(--gold-soft);
}
.btn-ghost:hover {
  background: rgba(255, 138, 0, 0.06);
  border-color: var(--gold);
}

.btn-text {
  background: none;
  border: none;
  color: var(--saffron-700);
  font-weight: 500;
  padding: 8px;
  min-height: 36px;
  font-size: 14.5px;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  cursor: pointer;
  transition: text-decoration-color 0.2s;
  width: auto;
}
.btn-text:hover { text-decoration-color: var(--saffron-700); }
.btn-text[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Spinner */
.btn .spinner {
  width: 18px; height: 18px;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Divider with text ─── */
.or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: var(--gap-md) 0;
  color: var(--ink-faint);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.or-divider::before, .or-divider::after {
  content: '';
  flex: 1; height: 1px;
  background: var(--gold-soft);
}

/* ─── Form ─── */
.form-group {
  margin-bottom: var(--gap-md);
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.form-input,
.phone-wrap input,
.otp-input {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 16px;       /* min 16px to prevent iOS auto-zoom */
  background: white;
  color: var(--ink);
  border: 1.5px solid var(--gold-soft);
  border-radius: var(--radius-md);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus,
.phone-wrap input:focus,
.otp-input:focus {
  outline: none;
  border-color: var(--saffron-500);
  box-shadow: 0 0 0 4px rgba(255, 138, 0, 0.12);
}
.form-input::placeholder { color: var(--ink-faint); }

.phone-wrap {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.phone-wrap .country-code {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  min-width: 64px;
  background: rgba(220, 166, 79, 0.12);
  border: 1.5px solid var(--gold-soft);
  border-radius: var(--radius-md);
  font-weight: 600;
  color: var(--ink-soft);
}
.phone-wrap input { flex: 1; }

.otp-input {
  text-align: center;
  font-size: 22px;
  letter-spacing: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.otp-input::placeholder { letter-spacing: 12px; }

/* ─── Inline messages ─── */
.msg {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: var(--gap-md);
  display: none;
  line-height: 1.4;
}
.msg.is-visible { display: block; }
.msg-error {
  background: #FEF1F0;
  color: var(--danger);
  border: 1px solid #FBC4C0;
}
.msg-success {
  background: #EFF8F4;
  color: var(--success);
  border: 1px solid #C5E5D5;
}
.msg-info {
  background: var(--cream-deep);
  color: var(--ink-soft);
  border: 1px solid var(--gold-soft);
}

/* ─── Hidden state ─── */
[hidden] { display: none !important; }

/* ─── Footer ─── */
.app-foot {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-faint);
  padding: var(--gap-md) var(--gap-md) calc(env(safe-area-inset-bottom) + var(--gap-md));
  letter-spacing: 0.3px;
  position: relative;
  z-index: 1;
}
.app-foot a { color: var(--ink-soft); text-decoration: none; }
.app-foot a:hover { color: var(--saffron-700); }

/* ═══════════════════════════════════════════════════════════════
   Dashboard-specific
   ═══════════════════════════════════════════════════════════════ */

.app-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--gap-sm) 0 var(--gap-lg);
  gap: var(--gap-sm);
}
.app-head .brand-mini {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--saffron-700);
  line-height: 1;
}
.app-head .user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  background: rgba(255, 248, 238, 0.7);
  border: 1px solid var(--gold-soft);
  border-radius: var(--radius-pill);
  cursor: pointer;
  position: relative;
}
.user-chip img {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid var(--gold);
}
.user-chip .name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border: 1px solid var(--gold-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 200px;
  padding: 6px;
  z-index: 10;
}
.user-menu button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--ink);
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 44px;
}
.user-menu button:hover { background: var(--cream-deep); }
.user-menu .divider { height: 1px; background: var(--gold-soft); margin: 4px 0; }

.welcome {
  text-align: center;
  margin: var(--gap-lg) 0;
}
.welcome h1 {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: clamp(28px, 6vw, 38px);
  color: var(--ink);
  margin-bottom: 6px;
}
.welcome h1 .accent {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--saffron-700);
  font-size: 1.4em;
  vertical-align: -0.05em;
}
.welcome p {
  color: var(--ink-soft);
  font-family: var(--font-head);
  font-style: italic;
  font-size: 17px;
}

.cta-card {
  max-width: 520px;
  margin: var(--gap-lg) auto;
  text-align: center;
  padding: var(--gap-lg) var(--gap-md);
  background: linear-gradient(160deg, rgba(255, 232, 200, 0.5), rgba(255, 248, 238, 0.85));
  border: 1.5px dashed var(--gold);
  border-radius: var(--radius-lg);
}
.cta-card .cta-icon {
  font-size: 48px;
  display: block;
  margin-bottom: var(--gap-sm);
}
.cta-card h3 {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 600;
  color: var(--saffron-900);
  margin-bottom: 6px;
}
.cta-card p {
  color: var(--ink-soft);
  font-size: 15px;
  max-width: 380px;
  margin: 0 auto var(--gap-md);
  line-height: 1.55;
}

.empty-state {
  text-align: center;
  padding: var(--gap-lg) var(--gap-md);
  color: var(--ink-faint);
  font-style: italic;
  font-family: var(--font-head);
}

/* ─── Hero shloka (subtle Sanskrit blessing) ─── */
.shloka {
  text-align: center;
  font-family: var(--font-deva);
  font-size: 14px;
  color: var(--ink-faint);
  margin-bottom: var(--gap-md);
  letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════════════
   Mobile refinements
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .card { padding: 24px 22px; border-radius: var(--radius-md); }
  .user-chip .name { max-width: 90px; }
  body::before, body::after { width: 160px; height: 160px; }
}

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