/*
 * Vivah Invite Studio — Dark theme overrides and Studio-specific styles.
 * Imports vivah.css variables and adds Studio-specific components.
 * 
 * COLOR PALETTE (dark mode):
 *   bg: #100A02 (deep brown-black)
 *   text: #FAF8F3 (ivory)
 *   accent: #C9943C (gold)
 *   secondary: #B85C4A (rose)
 *   success: #2D7A4F (green)
 */

/* ── STUDIO BASE ── */
.studio-body {
  background: #100A02;
  color: #FAF8F3;
  min-height: 100vh;
}

/* ── AMBIENT GLOW ── */
.amb { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.amb::before {
  content: ''; position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
  width: 1200px; height: 800px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(201,148,60,.07) 0%, transparent 65%);
}
.amb::after {
  content: ''; position: absolute; bottom: -100px; right: -100px;
  width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(184,92,74,.05) 0%, transparent 65%);
}

/* ── TOPBAR ── */
.topbar {
  position: sticky; top: 0; z-index: 200;
  background: rgba(16,10,2,.94); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 58px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
}

.tb-logo { display: flex; align-items: center; gap: 10px; cursor: pointer; text-decoration: none; }
.tb-logo-icon {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--rose));
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.tb-logo-text {
  font-family: var(--font-serif); font-size: 21px; font-weight: 500; color: var(--ivory);
}
.tb-logo-text span { color: var(--gold-l); }
.tb-badge {
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  color: var(--gold-l); background: rgba(201,148,60,.12);
  border: 1px solid rgba(201,148,60,.25); border-radius: 50px; padding: 3px 9px;
}

.tb-center { display: flex; gap: 4px; }
.tb-tab {
  padding: 6px 14px; border-radius: 50px; font-size: 12px; font-weight: 500;
  color: rgba(250,248,243,.5); cursor: pointer; border: 1px solid transparent;
  transition: all .2s; background: transparent; font-family: var(--font-body);
}
.tb-tab:hover { color: var(--gold-l); }
.tb-tab.active {
  background: rgba(201,148,60,.12); border-color: rgba(201,148,60,.3); color: var(--gold-l);
}

.tb-right { display: flex; align-items: center; gap: 8px; }

.btn-sm {
  padding: 6px 16px; border-radius: 50px; font-family: var(--font-body);
  font-size: 12px; font-weight: 500; cursor: pointer; transition: all .2s;
}
.btn-sm-o {
  border: 1px solid var(--border); background: transparent; color: rgba(250,248,243,.65);
}
.btn-sm-o:hover { border-color: var(--gold); color: var(--gold-l); }
.btn-sm-p {
  border: none; background: linear-gradient(135deg, var(--gold), var(--rose));
  color: #100A02; font-weight: 700;
}
.btn-sm-p:hover { opacity: .85; }

/* ── CONTAINER ── */
.studio-container {
  position: relative; z-index: 1; max-width: 1000px; margin: 0 auto;
  padding: 32px 20px 80px;
}

/* ── TAB PAGES ── */
.tab-page { display: none; }
.tab-page.active { display: block; }

/* ── SECTION CARD ── */
.sec {
  background: rgba(250,248,243,.03); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px; margin-bottom: 20px;
}
.sec-title {
  font-family: var(--font-serif); font-size: 22px; font-weight: 500;
  color: var(--gold-l); margin-bottom: 6px;
}
.sec-sub { font-size: 13px; color: rgba(250,248,243,.4); margin-bottom: 20px; }

/* ── STEP BAR ── */
.step-bar {
  display: flex; align-items: center; justify-content: center; gap: 0;
  margin-bottom: 32px; padding: 20px 0;
}
.step-dot {
  width: 38px; height: 38px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 14px; font-weight: 600;
  border: 2px solid rgba(250,248,243,.15); color: rgba(250,248,243,.3);
  background: transparent; cursor: pointer; transition: all .3s; position: relative;
}
.step-dot.active {
  border-color: var(--gold); color: var(--gold-l);
  background: rgba(201,148,60,.15);
  box-shadow: 0 0 20px rgba(201,148,60,.2);
}
.step-dot.done { border-color: var(--green); color: var(--green); background: rgba(45,122,79,.12); }
.step-label {
  position: absolute; top: 44px; font-size: 10px; white-space: nowrap;
  color: rgba(250,248,243,.3); transition: color .3s;
}
.step-dot.active .step-label { color: var(--gold-l); }
.step-dot.done .step-label { color: var(--green); }
.step-line {
  width: 60px; height: 2px; background: rgba(250,248,243,.1); transition: background .3s;
}
.step-line.done { background: var(--green); }

/* ── WIZARD PAGES ── */
.page { display: none; }
.page.active { display: block; }

/* ── FUNCTION CARDS (Step 1) ── */
.fn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.fn-card {
  background: rgba(250,248,243,.03); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px 16px; cursor: pointer;
  transition: all .25s; text-align: center;
}
.fn-card:hover { border-color: rgba(201,148,60,.4); transform: translateY(-2px) scale(1.02); }
.fn-card.sel {
  border-color: var(--gold); background: rgba(201,148,60,.08);
  box-shadow: 0 0 24px rgba(201,148,60,.12);
}
.fn-card .fn-em { font-size: 32px; margin-bottom: 8px; }
.fn-card .fn-name { font-size: 14px; font-weight: 600; color: var(--ivory); margin-bottom: 4px; }
.fn-card .fn-desc { font-size: 11px; color: rgba(250,248,243,.4); }
.fn-card .fn-check {
  display: none; position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px; border-radius: 50%; background: var(--gold);
  color: #100A02; font-size: 12px; line-height: 22px; text-align: center;
}
.fn-card.sel .fn-check { display: block; }
.fn-card { position: relative; }

/* ── FORM FIELDS ── */
.fg { display: grid; gap: 14px; }
.fg2 { grid-template-columns: 1fr 1fr; }
.fg3 { grid-template-columns: 1fr 1fr 1fr; }
.fgrp { display: flex; flex-direction: column; gap: 4px; }
.fgrp label {
  font-size: 11px; font-weight: 500; color: rgba(250,248,243,.5);
  text-transform: uppercase; letter-spacing: .04em;
}
.fgrp input, .fgrp select, .fgrp textarea {
  background: rgba(250,248,243,.05); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; font-size: 13px;
  color: var(--ivory); font-family: var(--font-body);
  transition: border-color .2s;
}
.fgrp input:focus, .fgrp select:focus, .fgrp textarea:focus {
  outline: none; border-color: var(--gold);
}
.fgrp textarea { resize: vertical; min-height: 80px; }
.fgrp select { cursor: pointer; }
.fgrp select option { background: #1A0A04; color: var(--ivory); }

/* ── FUNCTION DATE BLOCKS (Step 2, dynamic) ── */
.fn-date-block {
  background: rgba(250,248,243,.03); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; margin-bottom: 12px;
}
.fn-date-hdr {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}

/* ── TEMPLATE GRID (Step 3) ── */
.tmpl-filters { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.tf-btn {
  padding: 6px 14px; border-radius: 50px; font-size: 12px;
  border: 1px solid var(--border); background: transparent;
  color: rgba(250,248,243,.5); cursor: pointer; transition: all .2s;
  font-family: var(--font-body);
}
.tf-btn:hover { border-color: rgba(201,148,60,.4); color: var(--gold-l); }
.tf-btn.active {
  background: rgba(201,148,60,.12); border-color: rgba(201,148,60,.3); color: var(--gold-l);
}

.tmpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tmpl-card {
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  cursor: pointer; transition: all .3s; position: relative;
}
.tmpl-card:hover { border-color: rgba(201,148,60,.4); transform: translateY(-3px) scale(1.03); }
.tmpl-card.sel {
  border-color: var(--gold); box-shadow: 0 0 30px rgba(201,148,60,.15);
}
.tmpl-badge {
  position: absolute; top: 8px; right: 8px; font-size: 9px; font-weight: 700;
  letter-spacing: .06em; padding: 3px 8px; border-radius: 50px; z-index: 2;
}
.tmpl-badge.free { background: rgba(45,122,79,.2); color: #6ED9A0; border: 1px solid rgba(45,122,79,.3); }
.tmpl-badge.pro {
  background: rgba(201,148,60,.15); color: var(--gold-l);
  border: 1px solid rgba(201,148,60,.3);
}
.tmpl-preview {
  height: 200px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 16px;
  font-family: var(--font-serif); text-align: center;
}
.tmpl-sel-check {
  display: none; position: absolute; top: 8px; left: 8px;
  width: 24px; height: 24px; border-radius: 50%; background: var(--gold);
  color: #100A02; font-size: 14px; font-weight: 700;
  line-height: 24px; text-align: center;
}
.tmpl-card.sel .tmpl-sel-check { display: block; }
.tmpl-info { padding: 10px 14px; border-top: 1px solid var(--border); }
.tmpl-name { font-size: 13px; font-weight: 600; color: var(--ivory); }
.tmpl-meta { font-size: 11px; color: rgba(250,248,243,.4); margin-top: 2px; }

/* ── PREVIEW (Step 4) ── */
.preview-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; }
.pv-phone {
  width: 100%; max-width: 380px; margin: 0 auto;
  aspect-ratio: 9/16; border-radius: 30px; overflow: hidden;
  border: 2px solid rgba(250,248,243,.1); position: relative;
}
.bi-invite {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 40px 20px;
  text-align: center; position: relative;
}
.bi-ornament { font-size: 18px; letter-spacing: 6px; margin-bottom: 12px; opacity: .6; }
.bi-label { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; opacity: .5; margin-bottom: 16px; }
.bi-names { font-family: var(--font-serif); font-size: 36px; font-weight: 400; line-height: 1.1; }
.bi-names .amp { font-style: italic; font-size: 28px; margin: 0 4px; }
.bi-divider { width: 60px; height: 1px; margin: 16px auto; opacity: .3; }
.bi-fn-chip {
  display: inline-block; font-size: 9px; letter-spacing: .15em; text-transform: uppercase;
  padding: 3px 10px; border: 1px solid; border-radius: 50px; margin: 3px 2px;
}
.bi-venue { font-size: 12px; margin-top: 12px; opacity: .6; }
.bi-countdown {
  display: flex; gap: 16px; margin-top: 20px; font-size: 11px; text-align: center;
}
.bi-countdown .cd-val { font-size: 32px; font-weight: 300; font-family: var(--font-serif); }
.bi-countdown .cd-lbl { font-size: 9px; text-transform: uppercase; letter-spacing: .1em; opacity: .5; }
.bi-footer {
  position: absolute; bottom: 16px; font-size: 10px; opacity: .3; letter-spacing: .05em;
}

/* ── SHARE PANEL (Step 4 sidebar) ── */
.share-panel { display: flex; flex-direction: column; gap: 14px; }
.share-sum {
  background: rgba(250,248,243,.03); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px;
}
.share-sum-row {
  display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0;
  border-bottom: 1px solid rgba(250,248,243,.05);
}
.share-sum-row:last-child { border-bottom: none; }
.share-sum-label { color: rgba(250,248,243,.4); }
.share-sum-val { font-weight: 500; color: var(--ivory); }

.share-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-btn {
  padding: 12px; border-radius: 12px; border: 1px solid var(--border);
  background: rgba(250,248,243,.03); color: var(--ivory); font-size: 12px;
  font-weight: 500; cursor: pointer; text-align: center; transition: all .2s;
  font-family: var(--font-body);
}
.share-btn:hover { border-color: var(--gold); background: rgba(201,148,60,.08); }

/* ── THEME CUSTOMIZER ── */
.theme-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.theme-row-label { font-size: 11px; color: rgba(250,248,243,.5); min-width: 60px; }
.color-row { display: flex; gap: 6px; }
.color-swatch {
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: all .2s;
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.active { border-color: var(--ivory); box-shadow: 0 0 10px rgba(250,248,243,.2); }
.font-chip {
  padding: 4px 12px; border-radius: 50px; font-size: 11px;
  border: 1px solid var(--border); background: transparent;
  color: rgba(250,248,243,.5); cursor: pointer; transition: all .2s;
}
.font-chip:hover { border-color: rgba(201,148,60,.4); color: var(--gold-l); }
.font-chip.active { background: rgba(201,148,60,.12); border-color: rgba(201,148,60,.3); color: var(--gold-l); }

/* ── STATS CARDS (Analytics / Guests) ── */
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 24px; }
.stat-card {
  background: rgba(250,248,243,.03); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px; text-align: center;
}
.stat-val { font-family: var(--font-serif); font-size: 32px; font-weight: 400; color: var(--gold-l); }
.stat-lbl { font-size: 11px; color: rgba(250,248,243,.4); margin-top: 4px; }

/* ── GUEST TABLE ── */
.guest-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tab-pill {
  padding: 5px 14px; border-radius: 50px; font-size: 12px;
  border: 1px solid var(--border); background: transparent;
  color: rgba(250,248,243,.5); cursor: pointer; font-family: var(--font-body);
  transition: all .2s;
}
.tab-pill:hover { border-color: rgba(201,148,60,.4); color: var(--gold-l); }
.tab-pill.active { background: rgba(201,148,60,.12); border-color: rgba(201,148,60,.3); color: var(--gold-l); }

.guest-tbl {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.guest-tbl thead th {
  text-align: left; padding: 10px 12px; font-size: 10px;
  text-transform: uppercase; letter-spacing: .06em;
  color: rgba(250,248,243,.4); border-bottom: 1px solid var(--border);
}
.guest-tbl tbody td {
  padding: 10px 12px; border-bottom: 1px solid rgba(250,248,243,.04);
}
.guest-tbl tbody tr:hover { background: rgba(201,148,60,.03); }

.g-badge {
  font-size: 11px; padding: 3px 10px; border-radius: 50px; font-weight: 500;
}
.g-going { background: rgba(45,122,79,.15); color: #6ED9A0; }
.g-maybe { background: rgba(232,184,90,.12); color: var(--gold-l); }
.g-pending { background: rgba(250,248,243,.06); color: rgba(250,248,243,.4); }
.g-no { background: rgba(184,92,74,.12); color: var(--rose-l); }

/* ── ADD GUEST FORM ROW ── */
.add-guest-row {
  display: grid; grid-template-columns: 2fr 1.5fr 1fr 1fr auto;
  gap: 8px; align-items: end; margin-top: 16px;
}
.add-guest-row input, .add-guest-row select {
  background: rgba(250,248,243,.05); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 12px; font-size: 12px;
  color: var(--ivory); font-family: var(--font-body);
}
.add-guest-row input:focus, .add-guest-row select:focus { outline: none; border-color: var(--gold); }
.add-guest-row select option { background: #1A0A04; color: var(--ivory); }

/* ── BUTTONS ── */
.btn-gold {
  padding: 10px 24px; border-radius: 50px; border: none; font-family: var(--font-body);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all .2s;
  background: linear-gradient(135deg, var(--gold), var(--rose)); color: #100A02;
}
.btn-gold:hover { opacity: .85; }
.btn-outline {
  padding: 10px 24px; border-radius: 50px; font-family: var(--font-body);
  font-size: 13px; font-weight: 500; cursor: pointer; transition: all .2s;
  border: 1px solid var(--border); background: transparent; color: rgba(250,248,243,.65);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold-l); }
.btn-sm-action {
  font-size: 10px; padding: 3px 10px; border-radius: 50px;
  border: 1px solid rgba(201,148,60,.3); background: rgba(201,148,60,.15);
  color: var(--gold-l); cursor: pointer; font-family: var(--font-body);
}
.btn-sm-danger {
  font-size: 10px; padding: 3px 8px; border-radius: 50px;
  background: rgba(255,255,255,.05); border: 1px solid var(--border);
  color: rgba(250,248,243,.4); cursor: pointer; font-family: var(--font-body);
}

/* ── ANALYTICS CHARTS ── */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chart-card {
  background: rgba(250,248,243,.03); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px;
}
.chart-title { font-size: 14px; font-weight: 600; margin-bottom: 16px; color: var(--ivory); }
.bc-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; }
.bc-label { min-width: 32px; color: rgba(250,248,243,.5); }
.bc-track { flex: 1; height: 8px; background: rgba(250,248,243,.06); border-radius: 4px; overflow: hidden; }
.bc-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--gold), var(--gold-l)); }
.bc-val { min-width: 28px; text-align: right; color: rgba(250,248,243,.5); }

/* ── SETTINGS ── */
.setting-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid rgba(250,248,243,.05);
}
.setting-label { font-size: 13px; color: var(--ivory); }
.setting-desc { font-size: 11px; color: rgba(250,248,243,.35); margin-top: 2px; }
.toggle {
  width: 40px; height: 22px; border-radius: 11px; cursor: pointer; position: relative;
  background: rgba(250,248,243,.1); transition: background .2s;
}
.toggle.on { background: var(--gold); }
.toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%; background: var(--ivory);
  transition: transform .2s;
}
.toggle.on::after { transform: translateX(18px); }

/* ── LANGUAGE CHIPS ── */
.lang-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lang-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 50px; font-size: 12px;
  border: 1px solid var(--border); background: transparent;
  color: rgba(250,248,243,.5); cursor: pointer; transition: all .2s;
}
.lang-chip:hover { border-color: rgba(201,148,60,.4); color: var(--gold-l); }
.lang-chip.active { background: rgba(201,148,60,.12); border-color: rgba(201,148,60,.3); color: var(--gold-l); }

/* ── NAV BUTTONS ── */
.step-nav { display: flex; justify-content: space-between; margin-top: 28px; gap: 12px; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: rgba(16,10,2,.92); border: 1px solid var(--border);
  color: var(--gold-l); font-size: 13px; padding: 10px 24px;
  border-radius: 50px; z-index: 999; opacity: 0; transition: all .3s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── LOADING OVERLAY ── */
.studio-loading {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(16,10,2,.8); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  font-size: 15px; color: var(--gold-l);
}
.studio-loading.visible { display: flex; }

/* ── MODAL ── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.6); backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #1A0A04; border: 1px solid var(--border); border-radius: 20px;
  padding: 32px; max-width: 460px; width: 90%; position: relative;
}
.modal-close {
  position: absolute; top: 12px; right: 16px; font-size: 20px;
  color: rgba(250,248,243,.4); cursor: pointer; background: none; border: none;
}
.modal-title { font-family: var(--font-serif); font-size: 22px; color: var(--gold-l); margin-bottom: 8px; }
.modal-sub { font-size: 13px; color: rgba(250,248,243,.4); margin-bottom: 20px; }

/* ── URL PREVIEW ── */
.url-preview {
  background: rgba(250,248,243,.05); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; display: flex; align-items: center;
  gap: 8px; font-size: 12px; color: rgba(250,248,243,.5);
}
.url-prefix { color: rgba(250,248,243,.3); }
.url-slug { color: var(--gold-l); font-weight: 500; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .topbar { padding: 0 14px; }
  .tb-center { display: none; }
  .studio-container { padding: 16px 12px 60px; }
  .fn-grid { grid-template-columns: 1fr 1fr; }
  .fg2, .fg3 { grid-template-columns: 1fr; }
  .tmpl-grid { grid-template-columns: 1fr 1fr; }
  .preview-layout { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .add-guest-row { grid-template-columns: 1fr; }
  .share-btns { grid-template-columns: 1fr; }
}

/* ── MOBILE BOTTOM NAV ── */
@media (max-width: 768px) {
  .mobile-tabs {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(16,10,2,.96); border-top: 1px solid var(--border);
    z-index: 200; padding: 8px 0;
  }
  .mobile-tabs .tb-tab { flex: 1; text-align: center; border-radius: 0; font-size: 11px; padding: 8px 4px; }
}
@media (min-width: 769px) {
  .mobile-tabs { display: none; }
}

/* ── FOCUS-VISIBLE — Keyboard-only focus ring for a11y ── */
.fn-card:focus-visible,
.tmpl-card:focus-visible,
.step-dot:focus-visible,
.toggle:focus-visible,
.btn-gold:focus-visible,
.btn-outline:focus-visible,
.tb-tab:focus-visible,
.color-swatch:focus-visible,
.font-chip:focus-visible,
.tf-btn:focus-visible,
.tab-pill:focus-visible {
  outline: 2px solid var(--gold-l);
  outline-offset: 2px;
}
