/* HHSG claim portal & member dashboard styles.
   Served as a static asset (referenced via <link rel="stylesheet" href="/styles/portal.css">)
   so it works both from Astro-prerendered claim pages and from the /members/ Pages Function
   HTML responses. All colors use the project's design tokens.
*/

:root {
  --brand-primary: #004990;
  --brand-accent:  #F96302;
  --brand-teal:    #0D9488;
  --brand-gold:    #D4A017;
  --brand-navy:    #012169;
  --bg-base:       #FAF7F0;
  --bg-surface:    #FFFFFF;
  --text-primary:  #1A1A1A;
  --text-muted:    #6B7280;
  --border-soft:   #E5E0D2;
  --error:         #B91C1C;
  --success:       #15803D;
  --radius-md:     0.5rem;
}

* { box-sizing: border-box; }

body.bg-base {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans Variable', 'Plus Jakarta Sans Fallback',
               -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  min-height: 100vh;
}

.hidden { display: none !important; }
.required { color: var(--brand-accent); }
.optional { color: var(--text-muted); font-weight: 400; font-size: 0.85rem; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.claim-header,
.member-header {
  background: var(--bg-surface);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.claim-logo img,
.member-logo img {
  height: 36px;
  width: auto;
}
.member-header__right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.member-name { font-weight: 600; }

/* ── Containers ──────────────────────────────────────────────────────────── */
.claim-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}
.claim-container--narrow { max-width: 560px; }

.member-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

/* ── Step progress ───────────────────────────────────────────────────────── */
.step-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.step-progress__step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.step-progress__num {
  display: inline-flex;
  width: 1.75rem;
  height: 1.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.85rem;
}
.step-progress__step--active .step-progress__num {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}
.step-progress__step--active .step-progress__label { color: var(--text-primary); font-weight: 600; }
.step-progress__step--done .step-progress__num {
  background: var(--brand-teal);
  color: #fff;
  border-color: var(--brand-teal);
}
.step-progress__divider {
  flex: 1;
  height: 1px;
  background: var(--border-soft);
  min-width: 1rem;
}
.step-progress__divider--done { background: var(--brand-teal); }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.claim-card,
.success-card,
.member-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}
.claim-title,
.success-title,
.panel-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}
.claim-subtitle,
.success-body {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.4rem;
}
.form-input,
.form-textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-primary);
}
.form-textarea { min-height: 7rem; resize: vertical; }
.form-textarea--mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }
.form-input:focus-visible,
.form-textarea:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-color: var(--brand-primary);
}
.form-input--code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.5rem;
  letter-spacing: 0.5rem;
  text-align: center;
}
.form-hint {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 0.4rem 0 0;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
  text-decoration: none;
  transition: opacity 0.15s ease, background 0.15s ease;
  font-family: inherit;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn--primary { background: var(--brand-primary); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--brand-navy); }
.btn--secondary { background: var(--brand-teal); color: #fff; }
.btn--accent  { background: var(--brand-accent); color: #fff; }
.btn--outline { background: transparent; color: var(--brand-primary); border-color: var(--brand-primary); }
.btn--ghost   { background: transparent; color: var(--text-muted); }
.btn--full    { width: 100%; }
.btn--lg      { padding: 0.85rem 1.4rem; font-size: 1rem; }

.link-btn {
  background: none;
  border: 0;
  color: var(--brand-primary);
  cursor: pointer;
  text-decoration: underline;
  font: inherit;
  padding: 0;
}
.link-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.link-btn--centered { display: block; text-align: center; margin-top: 1.5rem; }

/* ── Error & save messages ──────────────────────────────────────────────── */
.error-text {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 0.4rem;
}
.error-text--block {
  padding: 0.75rem;
  background: rgba(185, 28, 28, 0.08);
  border-radius: var(--radius-md);
}
.save-message {
  font-size: 0.85rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  margin: 0.75rem 0;
}
.save-message--success { background: rgba(21, 128, 61, 0.1); color: var(--success); }
.save-message--error   { background: rgba(185, 28, 28, 0.1); color: var(--error); }

/* ── Confirm card / search results ──────────────────────────────────────── */
.business-confirm-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 0.5rem 0 1rem;
  background: var(--bg-base);
}
.confirm-label { font-weight: 600; margin: 0 0 0.5rem; }
.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}
.biz-card-mini {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.biz-card-mini__name { font-size: 1.05rem; font-weight: 700; }
.biz-card-mini__address { color: var(--text-muted); font-size: 0.9rem; }
.biz-card-mini__rating { color: var(--text-muted); font-size: 0.85rem; }
.skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, #eee, #f5f5f5, #eee);
  background-size: 200% 100%;
  animation: skel 1.2s linear infinite;
  border-radius: 4px;
  margin: 6px 0;
  width: 60%;
}
.skeleton-line--wide { width: 80%; }
@keyframes skel { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

.search-results {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.search-result-item {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
}
.search-result-item:hover,
.search-result-item:focus-visible {
  border-color: var(--brand-primary);
  outline: none;
}
.sri-name { font-weight: 600; }
.sri-address { color: var(--text-muted); font-size: 0.85rem; }

/* ── Verify phase ────────────────────────────────────────────────────────── */
.verify-sent-msg { color: var(--text-muted); margin-bottom: 1rem; }
.resend-link { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.75rem; }

/* ── Photo upload ────────────────────────────────────────────────────────── */
.photo-upload-zone {
  position: relative;
  border: 2px dashed var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  background: var(--bg-base);
}
.photo-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.photo-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.photo-upload-icon { font-size: 1.5rem; }
.photo-hint { color: var(--text-muted); font-size: 0.8rem; }
.photo-preview { margin-top: 0.75rem; }
.photo-preview__img {
  max-width: 100%;
  max-height: 240px;
  border-radius: var(--radius-md);
}
.current-photo {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}
.current-photo__img {
  max-width: 200px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
}
.current-photo__label { color: var(--text-muted); font-size: 0.8rem; }

/* ── Word counter ───────────────────────────────────────────────────────── */
.char-counter { font-size: 0.8rem; color: var(--text-muted); margin: 0.3rem 0 0; }
.over-limit { color: var(--error); font-weight: 700; }
.submit-note { font-size: 0.82rem; color: var(--text-muted); margin: 0.6rem 0 0; text-align: center; }

/* ── Success card ────────────────────────────────────────────────────────── */
.success-card { text-align: center; }
.success-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 9999px;
  background: var(--brand-teal);
  color: #fff;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}
.next-steps {
  text-align: left;
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--bg-base);
  border-radius: var(--radius-md);
}
.next-steps__title { font-size: 1rem; font-weight: 700; margin: 0 0 0.5rem; }
.next-steps__list { padding-left: 1.25rem; color: var(--text-muted); }
.next-steps__list li { margin-bottom: 0.4rem; }
.upgrade-teaser {
  text-align: left;
  border: 1px solid var(--brand-accent);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
}
.upgrade-teaser__title { color: var(--brand-accent); font-weight: 700; margin: 0 0 0.4rem; }
.upgrade-teaser__body { font-size: 0.9rem; color: var(--text-muted); margin: 0 0 0.75rem; }

/* ── Member dashboard ────────────────────────────────────────────────────── */
.member-tier-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.member-tier-badge--unclaimed { background: var(--text-muted); color: #fff; }
.member-tier-badge--claimed   { background: var(--brand-teal); color: #fff; }
.member-tier-badge--enhanced  { background: var(--brand-gold); color: #1A1A1A; }
.member-tier-badge--partner   { background: var(--brand-primary); color: #fff; }

.member-biz-header {
  background: var(--bg-surface);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  margin-bottom: 1rem;
}
.member-biz-name { font-size: 1.4rem; font-weight: 700; margin: 0; }
.member-biz-address { color: var(--text-muted); margin: 0.25rem 0 0.5rem; }
.member-view-listing { color: var(--brand-primary); font-size: 0.9rem; }

.upgrade-success-banner {
  background: rgba(21, 128, 61, 0.12);
  color: var(--success);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  margin: 0 auto 1rem;
  max-width: 960px;
  font-weight: 600;
}

.member-tabs__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.member-tab {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  padding: 0.55rem 1rem;
  border-radius: 9999px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
}
.member-tab--active {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}

.review-aggregate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 1rem;
}
.review-aggregate__stars { font-weight: 700; }
.review-aggregate__count { color: var(--text-muted); }
.section-subtitle { font-size: 1.05rem; font-weight: 700; margin: 1rem 0 0.4rem; }
.section-hint { color: var(--text-muted); font-size: 0.85rem; margin: 0 0 1rem; }

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.insight-card {
  background: var(--bg-base);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.insight-card__num { font-size: 1.75rem; font-weight: 700; color: var(--brand-primary); }
.insight-card__label { color: var(--text-muted); font-size: 0.85rem; }
.loading-spinner { color: var(--text-muted); font-size: 0.9rem; padding: 1rem 0; }
.upgrade-nudge {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--brand-accent);
  border-radius: var(--radius-md);
}
.upgrade-nudge p { margin: 0 0 0.75rem; }

/* ── Tier cards ──────────────────────────────────────────────────────────── */
.tier-compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.tier-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.tier-card--current { outline: 2px solid var(--brand-primary); }
.tier-card__badge { font-weight: 700; font-size: 0.9rem; }
.tier-card__price { font-size: 1.5rem; font-weight: 700; }
.tier-card__price span { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.tier-card__features {
  margin: 0.5rem 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  color: var(--text-primary);
}
.tier-card__features li { margin-bottom: 0.2rem; }
.tier-card__current { color: var(--brand-primary); font-weight: 600; font-size: 0.85rem; }

.pro-upsell-card {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-navy));
  border-radius: var(--radius-md);
  color: #fff;
}
.pro-upsell-card__eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.8);
}
.pro-upsell-card__title { font-size: 1.2rem; font-weight: 700; margin: 0.3rem 0 0.5rem; }
.pro-upsell-card__body { color: rgba(255,255,255,0.92); margin: 0 0 1rem; font-size: 0.9rem; }

.info-banner {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: var(--bg-base);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ── Below-floor tier badge (for profile pages) ──────────────────────────── */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
}
.tier-badge--claimed   { background: var(--brand-teal);    color: #fff; }
.tier-badge--enhanced  { background: var(--brand-gold);    color: #1A1A1A; }
.tier-badge--partner   { background: var(--brand-primary); color: #fff; }
.tier-badge--below-floor { background: var(--text-muted); color: #fff; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 540px) {
  .step-progress__label { display: none; }
  .step-progress { gap: 0.25rem; }
}
