/* Client planning portal. Standalone and small: the portal no longer loads the admin app.css. */
:root {
  --ink: #12202a;
  --ink-soft: #4a5866;
  --muted: #7a8794;
  --line: #e7e2d9;
  --paper: #fbf9f5;
  --card: #ffffff;
  --teal: #116a7b;
  --teal-dark: #0c5260;
  --teal-soft: #e7f2f3;
  --gold: #b08d57;
  --green: #18794e;
  --radius: 14px;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Lexend", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); }
img { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.portal { max-width: 980px; margin: 0 auto; padding: 0 18px 64px; }

/* Brand bar */
.portal-brand { display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 14px 0; }
.portal-brand img { max-height: 40px; max-width: 200px; object-fit: contain; }
.portal-brand span { font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-soft); }

/* Hero */
.portal-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(36px, 7vw, 72px) clamp(24px, 6vw, 64px) calc(clamp(36px, 7vw, 72px) + 30px);
  border-radius: 22px;
  background: radial-gradient(120% 90% at 100% 0%, #1d5e69 0%, rgba(29,94,105,0) 60%), linear-gradient(160deg, #13232c 0%, #0d171d 100%);
  color: #f4efe6;
  text-align: center;
  box-shadow: 0 30px 60px -30px rgba(13,23,29,.55);
}
.portal-hero::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(214,190,146,.28);
  border-radius: 14px;
  pointer-events: none;
}
.portal-kicker { display: block; font-size: 12px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; color: #d6be92; }
.portal-hero h1 {
  margin: 16px auto 0;
  max-width: 14ch;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(40px, 8vw, 76px);
  line-height: 1.02;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
.portal-hero-meta { margin-top: 18px; color: rgba(244,239,230,.82); font-size: 17px; }
.portal-hero-meta span + span::before { content: "·"; margin: 0 10px; color: #d6be92; }
.portal-countdown {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 26px;
  padding: 10px 20px;
  border: 1px solid rgba(214,190,146,.4);
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  font-size: 14px;
  color: rgba(244,239,230,.86);
}
.portal-countdown strong { font-family: var(--serif); font-size: 26px; font-weight: 600; color: #fff; line-height: 1; }
.portal-hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }

/* Buttons */
.p-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font: 500 15px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, transform .15s ease;
}
.p-btn:hover { background: var(--teal-dark); }
.p-btn:active { transform: translateY(1px); }
.p-btn:focus-visible, .p-link:focus-visible, .portal-nav a:focus-visible { outline: 3px solid rgba(17,106,123,.35); outline-offset: 2px; }
.p-btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.p-btn.ghost:hover { background: #f3efe8; }
.p-btn.on-dark { background: #f4efe6; color: #13232c; }
.p-btn.on-dark:hover { background: #fff; }
.p-btn.on-dark.ghost { background: transparent; border-color: rgba(244,239,230,.35); color: #f4efe6; }
.p-btn.on-dark.ghost:hover { background: rgba(255,255,255,.08); }
.p-btn.small { min-height: 36px; padding: 0 14px; font-size: 13px; }
.p-btn svg { width: 16px; height: 16px; flex: none; }
.p-link { color: var(--teal); font-weight: 500; text-decoration: none; }
.p-link:hover { text-decoration: underline; }

/* Alerts */
.alert { margin: 16px 0 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-size: 15px; }
.alert.success { background: #ecfdf3; border-color: #abefc6; color: var(--green); }
.alert.danger { background: #fef3f2; border-color: #fecdca; color: #b42318; }
.alert.warning { background: #fffaeb; border-color: #fedf89; color: #b54708; }
.alert.info { background: #eef6ff; border-color: #b8dfff; color: #175cd3; }

/* Next step and progress */
.portal-next {
  position: relative;
  z-index: 1;
  margin: -34px clamp(10px, 4vw, 40px) 0;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 18px 40px -24px rgba(18,32,42,.35);
}
.portal-next-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.portal-next-label { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.portal-next h2 { margin-top: 4px; font-family: var(--serif); font-size: 24px; font-weight: 600; line-height: 1.2; }
.portal-next p { margin-top: 4px; color: var(--ink-soft); font-size: 15px; }
.portal-next .p-btn { flex: none; }
.portal-steps { display: flex; gap: 6px; margin: 20px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); list-style: none; }
.portal-steps li { flex: 1 1 0; min-width: 0; }
.portal-steps li::before { content: ""; display: block; height: 4px; border-radius: 4px; background: #ece7de; }
.portal-steps li.is-done::before { background: var(--teal); }
.portal-steps li.is-current::before { background: linear-gradient(90deg, var(--gold) 50%, #ece7de 50%); }
.portal-steps span { display: block; margin-top: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-steps li.is-done span { color: var(--ink); }
.portal-steps li.is-current span { color: var(--ink); font-weight: 600; }
.portal-steps li.is-done span::before { content: "✓ "; color: var(--teal); }

/* At-a-glance details */
.portal-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); }
.portal-facts div { padding: 16px 20px; background: var(--card); min-width: 0; }
.portal-facts dt { font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.portal-facts dd { margin: 4px 0 0; font-size: 16px; font-weight: 500; overflow-wrap: anywhere; }

/* Section jump links */
.portal-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 18px -18px 0;
  padding: 10px 18px;
  overflow-x: auto;
  background: rgba(251,249,245,.94);
  border-bottom: 1px solid transparent;
  scrollbar-width: none;
}
.portal-nav::-webkit-scrollbar { display: none; }
.portal-nav a { flex: none; padding: 8px 14px; border-radius: 999px; color: var(--ink-soft); font-size: 14px; font-weight: 500; text-decoration: none; }
.portal-nav a:hover { background: #f1ece3; color: var(--ink); }
.portal-nav a.is-due { color: var(--ink); background: #f5ecdc; }

/* Sections */
.portal-section { margin-top: 18px; padding: clamp(22px, 4vw, 34px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.portal-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.portal-section-head .portal-kicker { color: var(--gold); }
.portal-section h2 { margin-top: 6px; font-family: var(--serif); font-size: clamp(26px, 4vw, 32px); font-weight: 600; line-height: 1.15; }
.portal-section-head p { margin-top: 6px; color: var(--ink-soft); font-size: 15px; }
.portal-empty { color: var(--muted); }
.portal-status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: #f3efe8; color: var(--ink-soft); font-size: 13px; font-weight: 500; white-space: nowrap; }
.portal-status.done { background: #e8f5ee; color: var(--green); }
.portal-status.due { background: #f5ecdc; color: #8a6420; }

/* Music */
.portal-playlists { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.portal-embed { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #faf8f4; }
.portal-embed.is-loaded { border-color: transparent; background: transparent; }
.portal-embed iframe { display: block; width: 100%; border: 0; border-radius: 12px; }
.portal-embed-face { display: flex; align-items: center; gap: 14px; padding: 16px; }
.portal-embed-icon { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 10px; background: var(--ink); color: #f4efe6; }
.portal-embed-icon svg { width: 22px; height: 22px; }
.portal-embed-text { flex: 1; min-width: 0; }
.portal-embed-text strong { display: block; font-weight: 600; }
.portal-embed-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 14px; }
.portal-embed-actions button { padding: 0; border: 0; background: none; color: var(--teal); font: 500 14px var(--sans); cursor: pointer; }
.portal-embed-actions button:hover { text-decoration: underline; }
.portal-first-dance { margin-top: 12px; }

/* Venue */
.portal-venue { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 20px; align-items: start; }
.portal-venue address { font-style: normal; color: var(--ink-soft); }
.portal-venue strong { display: block; font-size: 18px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.portal-venue .p-btn { margin-top: 16px; }
.portal-map { min-height: 300px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #f1ece3; }
.portal-map iframe { display: block; width: 100%; border: 0; }

/* Notes */
.portal-notes { color: var(--ink-soft); white-space: pre-line; }

/* Quote */
.portal-money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.portal-money div { padding: 16px 18px; border-radius: 12px; background: #faf8f4; }
.portal-money span { display: block; font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.portal-money strong { display: block; margin-top: 4px; font-family: var(--serif); font-size: 26px; font-weight: 600; }
.portal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 20px; }
.portal-actions form { margin: 0; }
.portal-meta { color: var(--muted); font-size: 14px; }

/* Contract */
.portal-contract details { border: 1px solid var(--line); border-radius: 12px; }
.portal-contract summary { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; cursor: pointer; font-weight: 500; list-style: none; }
.portal-contract summary::-webkit-details-marker { display: none; }
.portal-contract summary::after { content: "+"; font-size: 20px; color: var(--muted); }
.portal-contract details[open] summary::after { content: "−"; }
.portal-contract pre { max-height: 420px; margin: 0; padding: 0 18px 18px; overflow: auto; white-space: pre-wrap; font: 400 14px/1.65 var(--sans); color: var(--ink-soft); }
.portal-sign { display: grid; gap: 16px; margin-top: 20px; }
.portal-sign label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
.portal-sign input[type="text"], .portal-sign input:not([type]) { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid #d8d2c7; border-radius: 10px; background: #fff; color: var(--ink); font: 400 16px var(--sans); }
.portal-sign input:focus { outline: 0; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(17,106,123,.15); }
.portal-sign-label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; }
.portal-pad { position: relative; }
.portal-pad canvas { display: block; width: 100%; height: 190px; border: 1px dashed #cfc7b8; border-radius: 12px; background: #fff; touch-action: none; cursor: crosshair; }
.portal-pad-hint { position: absolute; left: 18px; right: 18px; bottom: 34px; border-top: 1px solid #e3ddd2; padding-top: 6px; color: var(--muted); font-size: 13px; pointer-events: none; transition: opacity .15s ease; }
.portal-pad canvas.has-ink + .portal-pad-hint { opacity: 0; }
.portal-pad-tools { display: flex; justify-content: flex-end; margin-top: 6px; }
.portal-pad-tools button { padding: 4px 0; border: 0; background: none; color: var(--teal); font: 500 14px var(--sans); cursor: pointer; }
.portal-certificate { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 18px; margin-top: 20px; padding: 18px; border-radius: 12px; background: #faf8f4; }
.portal-certificate dl { display: grid; gap: 10px; margin: 0; }
.portal-certificate dt { font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.portal-certificate dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.portal-certificate .signature { display: grid; place-items: center; min-height: 110px; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.portal-certificate .signature img { max-height: 100px; }

.portal-footer { margin-top: 34px; text-align: center; color: var(--muted); font-size: 13px; }

@media (max-width: 720px) {
  .portal { padding: 0 12px 48px; }
  .portal-hero { border-radius: 18px; }
  .portal-hero::before { inset: 10px; }
  .portal-hero-meta span { display: block; }
  .portal-hero-meta span + span::before { content: none; }
  .portal-next { margin: -26px 6px 0; padding: 18px; }
  .portal-next-row { flex-direction: column; align-items: stretch; }
  .portal-next .p-btn { width: 100%; }
  .portal-steps span { font-size: 12px; }
  .portal-facts { grid-template-columns: 1fr; }
  .portal-facts div { padding: 12px 16px; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
  .portal-facts dd { margin: 0; text-align: right; }
  .portal-nav { justify-content: flex-start; margin: 14px -12px 0; padding: 8px 12px; }
  .portal-section-head { flex-direction: column; align-items: flex-start; }
  .portal-venue { grid-template-columns: 1fr; }
  .portal-money { grid-template-columns: 1fr; }
  .portal-money div { display: flex; justify-content: space-between; align-items: baseline; }
  .portal-money strong { margin: 0; font-size: 22px; }
  .portal-certificate { grid-template-columns: 1fr; }
  .portal-actions .p-btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
