/*
 * Check In Circle — verify subdomain theme.
 *
 * Shared by the onRequest-rendered verify pages (verifyContact, verifyEmail)
 * and any static pages hosted under hosting-verify/ (e.g. the invite claim
 * page added in a later phase of kammcs/checkin#237).
 *
 * Tokens mirror backend/hosting-admin/index.html and website/tailwind.config.mjs
 * so all three web surfaces read as one product. Light/dark via
 * prefers-color-scheme.
 */

:root {
  --primary: #2A9D8F;
  --primary-hover: #238b7e;
  --accent: #E9C46A;
  --error: #ef4444;
  --surface: #ffffff;
  --surface-alt: #f9fafb;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #f3f4f6;
  --nav-bg: rgba(255, 255, 255, 0.9);
  --nav-border: #f3f4f6;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #111827;
    --surface-alt: #030712;
    --text: #f3f4f6;
    --text-muted: #9ca3af;
    --border: #1f2937;
    --nav-bg: rgba(3, 7, 18, 0.9);
    --nav-border: #1f2937;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3);
  }
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--surface-alt);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header — shared across every page on the verify subdomain. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--nav-border);
}

.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--primary);
  font-size: 18px;
  font-weight: 700;
}

.site-brand img {
  width: 28px;
  height: 24px;
  display: block;
}

/* Main content area centers the page's card. */
.page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

/* Card — primary container for status pages. */
.card {
  background: var(--surface);
  border-radius: 16px;
  padding: 48px 40px;
  box-shadow: var(--shadow-card);
  max-width: 480px;
  width: 100%;
  text-align: center;
}

/* Status icon (check / cross in a circle). */
.status-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 32px;
  color: #ffffff;
  font-weight: 700;
  line-height: 1;
}

.status-icon.success {
  background: var(--primary);
}

.status-icon.error {
  background: var(--error);
}

/* Card typography. */
.card h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.card p {
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.5;
  font-size: 15px;
}

.card p:last-child {
  margin-bottom: 0;
}

/* Inline link style. */
.link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.link:hover {
  text-decoration: underline;
}

/* Learn-more block spacing under a status message. */
.learn-more {
  margin-top: 24px;
}

/* ─────────────────────────────────────────────────────────────────────────
 * Claim page components (/claim/*)
 * ────────────────────────────────────────────────────────────────────── */

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 36px;
  object-fit: cover;
  overflow: hidden;
}

img.avatar {
  background: var(--surface-alt);
}

.card h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.card .subhead {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.field {
  text-align: left;
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* Intl-tel-input override: widen to the card width and match our border
 * styling so it reads as one of our form fields. */
.iti {
  display: block !important;
  width: 100% !important;
}

.iti input.iti__tel-input,
.iti input.iti__tel-input[type="tel"],
.iti input.iti__tel-input[type="text"] {
  width: 100% !important;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline: none;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.iti input.iti__tel-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(42, 157, 143, 0.2);
}

@media (prefers-color-scheme: dark) {
  .iti input.iti__tel-input,
  .iti input.iti__tel-input[type="tel"],
  .iti input.iti__tel-input[type="text"] {
    background: var(--surface-alt);
    border-color: var(--border);
    color: var(--text);
  }
  .iti .iti__country-name,
  .iti .iti__selected-dial-code {
    color: var(--text);
  }
  .iti .iti__dropdown-content {
    background: var(--surface);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  }
}

.consent {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: -8px;
  margin-bottom: 16px;
  text-align: left;
}

/* Primary action button. */
.btn-primary {
  width: 100%;
  padding: 12px 16px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  padding: 8px 12px;
  margin-top: 8px;
  text-decoration: underline;
}

.btn-ghost:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  text-decoration: none;
}

/* Six-cell verification code input. */
.code-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 12px 0 8px;
}

.code-inputs input {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  border: 2px solid var(--border);
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}

.code-inputs input:focus {
  border-color: var(--primary);
}

@media (max-width: 420px) {
  .code-inputs input {
    width: 36px;
    height: 48px;
    font-size: 20px;
  }
}

.error-msg {
  color: var(--error);
  font-size: 13px;
  min-height: 20px;
  margin-top: 8px;
  text-align: center;
}

/* Small inline spinner used on primary buttons while waiting for the API. */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Store badges on the success state. Matches the marketing-site
   StoreButtons.astro pattern: dark pill background with a small
   caption stacked above the product name, inverted in dark mode. */
.store-badges {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-radius: 12px;
  background: #111827;
  color: #ffffff;
  text-decoration: none;
  transition: opacity 0.2s;
}

.store-badge:hover,
.store-badge:focus-visible {
  opacity: 0.9;
}

.store-badge-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
  flex-shrink: 0;
}

.store-badge-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.store-badge-caption {
  font-size: 10px;
  line-height: 1;
  font-weight: 400;
}

.store-badge-name {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 2px;
}

@media (prefers-color-scheme: dark) {
  .store-badge {
    background: #ffffff;
    color: #111827;
  }
}

/* Footer text on the claim page (privacy link etc.). */
.page-footer {
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.page-footer a {
  color: var(--text-muted);
  text-decoration: underline;
}

/* Hidden until JS decides what to show. Keeps the initial paint from
 * flashing unrendered markup while we fetch /api/claim/init. */
.js-hidden {
  display: none !important;
}
