/* ═══════════════════════════════════════════════════════════
   BAY LIFE EVENT SERVICES — BRAND STYLESHEET
   Black & Gold Ultra Sleek Theme
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
  /* Core palette */
  --black:     #000000;
  --black2:    #0a0a0a;
  --black3:    #111111;
  --black4:    #1a1a1a;
  --black5:    #222222;

  /* Gold spectrum */
  --gold:      #c9a84c;
  --gold2:     #e2c06a;
  --gold3:     #f0d48a;
  --gold-dim:  rgba(201,168,76,.15);
  --gold-glow: rgba(201,168,76,.35);

  /* Neutrals */
  --white:     #ffffff;
  --off-white: #f0ece4;
  --gray:      #888888;
  --gray2:     #555555;
  --gray3:     #333333;

  /* Status */
  --green:     #4a9e6b;
  --green-dim: rgba(74,158,107,.15);
  --red:       #c0392b;
  --red-dim:   rgba(192,57,43,.15);

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Montserrat', sans-serif;

  /* Spacing & radius */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  /* Shadows */
  --shadow:     0 8px 40px rgba(0,0,0,.6);
  --shadow-gold: 0 0 40px rgba(201,168,76,.2);
  --glow:       0 0 80px rgba(201,168,76,.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { font-family: var(--font-body); background: var(--black); color: var(--white); min-height: 100vh; overflow-x: hidden; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 2px; }

/* ── BACKGROUND ── */
.bg-main {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(201,168,76,.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(201,168,76,.04) 0%, transparent 50%),
    var(--black);
}
.bg-grain {
  position: fixed; inset: 0; z-index: 0; opacity: .025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ── LOGO ── */
.brand-logo {
  display: block;
  height: 52px;
  width: auto;
  object-fit: contain;
  /* Makes the black background invisible on black portal */
  mix-blend-mode: screen;
}
.brand-logo-lg {
  display: block;
  height: 80px;
  width: auto;
  object-fit: contain;
  mix-blend-mode: screen;
  margin: 0 auto;
}

/* ── NAV ── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(0,0,0,.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(201,168,76,.12);
  padding: 0 28px;
  height: 64px;
  display: flex; align-items: center; gap: 16px;
}
.nav-tabs { display: flex; gap: 2px; margin-left: auto; }
.nav-tab {
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer; border: none; background: transparent; color: var(--gray);
  transition: all .2s;
}
.nav-tab:hover { color: var(--white); }
.nav-tab.active { background: var(--gold-dim); color: var(--gold); }
.nav-owner-badge {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--black); font-size: 11px; font-weight: 700;
  padding: 4px 12px; border-radius: 999px; letter-spacing: .06em;
}

/* ── TABS (page level) ── */
.page-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: 0 28px;
  background: rgba(0,0,0,.5);
  position: relative; z-index: 1;
}
.page-tab {
  padding: 14px 20px; font-size: 12px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer; border: none; background: transparent;
  color: var(--gray); border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: all .2s;
}
.page-tab:hover { color: var(--white); }
.page-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ── CARDS ── */
.card {
  background: var(--black3);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 16px;
}
.card-gold {
  background: linear-gradient(135deg, rgba(201,168,76,.06), rgba(201,168,76,.02));
  border-color: rgba(201,168,76,.2);
}
.card-title {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 600; color: var(--gold);
  letter-spacing: .02em; margin-bottom: 4px;
}
.card-sub { font-size: 13px; color: var(--gray); line-height: 1.65; margin-bottom: 22px; }

/* ── STAT CARDS ── */
.stat-card {
  background: var(--black4);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-card .lbl { font-size: 10px; color: var(--gray); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.stat-card .val { font-size: 26px; font-weight: 700; color: var(--white); font-family: var(--font-display); }
.stat-card .sub { font-size: 11px; color: var(--gold); margin-top: 4px; }

/* ── FORM FIELDS ── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 10px; color: var(--gray); text-transform: uppercase; letter-spacing: .08em; }
.field input, .field select, .field textarea {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  padding: 13px 16px;
  color: var(--white);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color .2s, background .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--gold);
  background: rgba(201,168,76,.03);
}
.field select option { background: var(--black4); }
.field input::placeholder { color: rgba(255,255,255,.2); }
.field textarea { resize: vertical; min-height: 80px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media(max-width:520px){ .form-grid { grid-template-columns: 1fr; } }

/* ── BUTTONS ── */
.btn {
  padding: 13px 26px; border-radius: var(--radius);
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; border: none; transition: all .2s; font-family: var(--font-body);
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: var(--black);
  box-shadow: 0 4px 20px rgba(201,168,76,.25);
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(201,168,76,.4); }
.btn-gold:active { transform: translateY(0); }
.btn-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,.15);
  color: var(--white);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.btn-sm { padding: 8px 16px; font-size: 11px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* ── BADGES ── */
.badge { display: inline-flex; padding: 3px 11px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.badge-gold { background: rgba(201,168,76,.12); color: var(--gold); border: 1px solid rgba(201,168,76,.25); }
.badge-green { background: rgba(74,158,107,.15); color: #6fca96; border: 1px solid rgba(74,158,107,.3); }
.badge-red { background: rgba(192,57,43,.15); color: #e07070; border: 1px solid rgba(192,57,43,.3); }
.badge-gray { background: rgba(255,255,255,.06); color: var(--gray); border: 1px solid rgba(255,255,255,.1); }

/* ── DIVIDER ── */
.divider { height: 1px; background: rgba(255,255,255,.06); margin: 20px 0; }
.divider-gold { height: 1px; background: linear-gradient(90deg, transparent, rgba(201,168,76,.3), transparent); margin: 20px 0; }

/* ── TABLE ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { font-size: 10px; color: var(--gray); text-align: left; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.06); text-transform: uppercase; letter-spacing: .07em; }
.data-table td { font-size: 13px; padding: 13px 14px; border-bottom: 1px solid rgba(255,255,255,.04); color: var(--white); vertical-align: middle; }
.data-table tr:last-child td { border: none; }
.data-table tr:hover td { background: rgba(201,168,76,.02); }

/* ── CHAT ── */
.chat-wrap { background: var(--black4); border: 1px solid rgba(255,255,255,.06); border-radius: var(--radius-lg); overflow: hidden; }
.chat-header { padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,.05); display: flex; align-items: center; justify-content: space-between; }
.chat-header h4 { font-size: 14px; font-weight: 600; }
.chat-status { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #6fca96; }
.chat-status .dot { width: 6px; height: 6px; border-radius: 50%; background: #6fca96; animation: pulse 2s infinite; }
.messages { height: 320px; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg.user { flex-direction: row-reverse; }
.msg-av { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.msg-av.ai { background: var(--gold); color: var(--black); font-family: var(--font-display); font-size: 13px; }
.msg-av.user { background: var(--black5); color: var(--gray); }
.msg-bubble { max-width: 78%; padding: 11px 15px; border-radius: 14px; font-size: 13px; line-height: 1.65; }
.msg-bubble.ai { background: rgba(255,255,255,.05); color: #d4d4d4; border-radius: 14px 14px 14px 3px; }
.msg-bubble.user { background: var(--gold-dim); border: 1px solid rgba(201,168,76,.2); color: var(--white); border-radius: 14px 14px 3px 14px; }
.chat-input-row { padding: 14px; border-top: 1px solid rgba(255,255,255,.05); display: flex; gap: 10px; }
.chat-input { flex: 1; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius); padding: 11px 14px; color: var(--white); font-size: 13px; font-family: var(--font-body); resize: none; outline: none; transition: border-color .2s; }
.chat-input:focus { border-color: var(--gold); }
.send-btn { width: 40px; height: 40px; border-radius: var(--radius); background: var(--gold); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .2s; flex-shrink: 0; }
.send-btn:hover { background: var(--gold2); }
.send-btn svg { width: 15px; height: 15px; fill: var(--black); }

/* ── CONTRACT ── */
.contract-box { background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.06); border-radius: var(--radius); padding: 20px; font-size: 12.5px; line-height: 1.85; color: #c0c0c0; white-space: pre-wrap; max-height: 380px; overflow-y: auto; font-family: var(--font-body); }

/* ── SIGNATURE ── */
.sig-wrap { background: rgba(255,255,255,.02); border: 1.5px dashed rgba(201,168,76,.3); border-radius: var(--radius); padding: 16px; }
.sig-wrap p { font-size: 12px; color: var(--gray); margin-bottom: 10px; }
canvas { display: block; width: 100%; max-width: 500px; height: 110px; border-radius: 8px; background: rgba(255,255,255,.02); touch-action: none; cursor: crosshair; }

/* ── PROGRESS BAR ── */
.prog-circle { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.04); border: 2px solid rgba(255,255,255,.08); color: var(--gray); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; transition: all .3s; }
.prog-circle.active { border-color: var(--gold); color: var(--gold); background: rgba(201,168,76,.08); }
.prog-circle.done { background: var(--gold); border-color: var(--gold); color: var(--black); }
.prog-label { font-size: 10px; color: var(--gray); margin-top: 5px; text-align: center; letter-spacing: .04em; }
.prog-line { flex: 1; height: 2px; background: rgba(255,255,255,.07); margin: 0 -2px; margin-bottom: 18px; }
.prog-line.done { background: var(--gold); }

/* ── ALERT ── */
.alert { border-radius: var(--radius); padding: 13px 16px; font-size: 13px; margin-bottom: 16px; display: none; line-height: 1.55; }
.alert-err { background: rgba(192,57,43,.12); border: 1px solid rgba(192,57,43,.3); color: #e07070; }
.alert-ok { background: rgba(74,158,107,.12); border: 1px solid rgba(74,158,107,.3); color: #6fca96; }

/* ── LOADING ── */
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.08); border-top-color: var(--gold); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; margin-right: 6px; }
.loading { text-align: center; padding: 48px; color: var(--gray); font-size: 13px; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--gray); }
.empty-state .icon { font-size: 36px; margin-bottom: 12px; }
.empty-state p { font-size: 13px; }

/* ── TOAST ── */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: var(--gold); color: var(--black); padding: 12px 24px; border-radius: 999px; font-size: 13px; font-weight: 700; z-index: 999; display: none; box-shadow: 0 4px 24px rgba(201,168,76,.5); letter-spacing: .04em; }

/* ── MODAL ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.8); z-index: 200; display: none; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto; backdrop-filter: blur(4px); }
.modal-overlay.open { display: flex; }
.modal { background: var(--black3); border: 1px solid rgba(201,168,76,.15); border-radius: var(--radius-xl); padding: 32px; max-width: 680px; width: 100%; box-shadow: var(--shadow); }
.modal-close { float: right; background: none; border: none; color: var(--gray); font-size: 22px; cursor: pointer; margin-top: -4px; transition: color .2s; }
.modal-close:hover { color: var(--white); }

/* ── ANIMATIONS ── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:.3;} }
@keyframes typing { 0%,80%,100%{opacity:.2;transform:scale(.8);} 40%{opacity:1;transform:scale(1);} }
.fade-up { animation: fadeUp .5s ease both; }
.fade-up-2 { animation: fadeUp .5s .1s ease both; opacity: 0; }
.fade-up-3 { animation: fadeUp .5s .2s ease both; opacity: 0; }

/* ── SERVICE CARDS ── */
.svc-card { background: rgba(255,255,255,.02); border: 1.5px solid rgba(255,255,255,.07); border-radius: var(--radius-lg); padding: 20px; cursor: pointer; transition: all .2s; user-select: none; }
.svc-card:hover { border-color: rgba(201,168,76,.3); background: rgba(201,168,76,.03); }
.svc-card.selected { border-color: var(--gold); background: rgba(201,168,76,.07); }
.svc-card h4 { font-size: 14px; font-weight: 600; color: var(--white); margin-bottom: 5px; }
.svc-card p { font-size: 12px; color: var(--gray); line-height: 1.55; }
.svc-card .svc-price { font-size: 12px; color: var(--gold); margin-top: 8px; font-weight: 600; letter-spacing: .03em; }

/* ── ESTIMATE ── */
.est-card { background: linear-gradient(135deg, rgba(201,168,76,.07), rgba(201,168,76,.02)); border: 1px solid rgba(201,168,76,.2); border-radius: var(--radius-lg); padding: 24px; }
.est-card h3 { font-family: var(--font-display); font-size: 20px; color: var(--gold); margin-bottom: 18px; }
.est-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.04); font-size: 13px; }
.est-row:last-child { border: none; }
.est-row .d { color: var(--gray); }
.est-row .a { color: var(--white); font-weight: 500; }
.est-row.tot { font-size: 17px; font-weight: 700; color: var(--gold); font-family: var(--font-display); border-top: 1px solid rgba(201,168,76,.2); padding-top: 14px; margin-top: 6px; }
.deposit-banner { background: rgba(74,158,107,.1); border: 1px solid rgba(74,158,107,.25); border-radius: var(--radius); padding: 14px 18px; margin-top: 14px; display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.deposit-banner span:last-child { color: #6fca96; font-weight: 700; font-size: 16px; }

/* ── TIMELINE ── */
.tl-item { display: flex; gap: 14px; padding-bottom: 22px; }
.tl-left { display: flex; flex-direction: column; align-items: center; width: 38px; flex-shrink: 0; }
.tl-circle { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; z-index: 1; }
.tl-circle.done { background: rgba(74,158,107,.2); border: 2px solid rgba(74,158,107,.4); }
.tl-circle.active { background: rgba(201,168,76,.1); border: 2px solid rgba(201,168,76,.4); }
.tl-circle.pending { background: rgba(255,255,255,.03); border: 2px solid rgba(255,255,255,.08); }
.tl-line { flex: 1; width: 2px; background: rgba(255,255,255,.06); margin: 4px auto; }
.tl-body { flex: 1; padding-top: 7px; }
.tl-body h4 { font-size: 14px; font-weight: 600; color: var(--white); margin-bottom: 3px; }
.tl-body p { font-size: 12px; color: var(--gray); line-height: 1.6; }

/* ── FOOTER ── */
.portal-footer { position: relative; z-index: 1; text-align: center; padding: 24px; font-size: 11px; color: var(--gray2); letter-spacing: .05em; border-top: 1px solid rgba(255,255,255,.04); margin-top: 20px; }

/* ── MOBILE RESPONSIVE ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav { padding: 0 14px; height: 56px; gap: 8px; }
  .nav img.brand-logo { height: 28px; }
  .nav-owner-badge { font-size: 10px; padding: 3px 8px; }

  .page-tabs { padding: 0 10px; overflow-x: auto; white-space: nowrap; gap: 0; }
  .page-tab { padding: 10px 12px; font-size: 10px; }

  .main { padding: 16px 12px 60px; }

  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 14px; }
  .stat-card .val { font-size: 20px; }

  .card { padding: 18px 14px; }
  .card-title { font-size: 18px; }

  .form-grid { grid-template-columns: 1fr !important; }
  .form-grid [style*="grid-column:span 2"] { grid-column: span 1 !important; }

  table { font-size: 12px; }
  th, td { padding: 8px 8px; }

  .cal-grid { gap: 2px; }
  .cal-day { font-size: 11px; border-radius: 6px; }
  .cal-day-name { font-size: 10px; }

  .btn { padding: 10px 16px; font-size: 12px; }
  .btn-row { gap: 8px; }

  .modal { padding: 20px 16px; margin: 10px; }
  .modal-tabs { overflow-x: auto; white-space: nowrap; }
  .modal-tab { padding: 8px 10px; font-size: 10px; }

  .service-grid { grid-template-columns: 1fr !important; }
  .svc-card { padding: 16px 14px; }

  .est-card { padding: 16px; }
  .deposit-banner { flex-direction: column; gap: 6px; text-align: center; }

  .progress-bar, .steps { overflow-x: auto; }
  .prog-label { font-size: 9px; }

  .chat-wrap .messages { height: 260px; }

  .login-card { padding: 24px 18px; }
  .logo-wrap img { height: 70px; }

  .stripe-btn { font-size: 14px; padding: 14px; }

  /* Fix nav tabs on owner dashboard mobile */
  [style*="display:flex;gap:2px;padding:0 28px"] {
    padding: 0 10px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Owner Messages: single-pane on mobile */
  .msg-shell { grid-template-columns: 1fr !important; height: calc(100vh - 220px) !important; min-height: 480px; }
  .msg-shell[data-view="list"] .msg-thread { display: none !important; }
  .msg-shell[data-view="thread"] .msg-list { display: none !important; }
  .msg-back-btn { display: inline-flex !important; }
}

.msg-back-btn { display: none; }

.portal-signout-btn {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.15);
  color: var(--gray);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-body);
  letter-spacing: .03em;
  transition: color .2s, border-color .2s;
  white-space: nowrap;
}
.portal-signout-btn:hover { color: var(--gold); border-color: rgba(201,168,76,.4); }
.portal-signout-btn:active { transform: scale(.97); }

@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat-card .val { font-size: 17px; }
  .nav span[style*="letter-spacing"] { display: none; }
  #navGreeting { display: none; }
  .portal-signout-btn { padding: 9px 14px; font-size: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .progress-bar { gap: 2px; }
  .prog-line { max-width: 16px; }
  .prog-label { display: none; }
}
