/* Sign portal — Palate Partners brand
 *
 * Mirrors the design tokens from crm/frontend/src/tokens.css (wine + gold
 * on cream, Cormorant Garamond display / DM Sans body). The card width
 * widens with the viewport so the embedded PDF iframe has room to render
 * at a readable scale on tablet + desktop; on small screens it falls
 * back to a vertical single-column layout.
 */

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

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

:root {
  /* Brand — kept in sync with crm/frontend/src/tokens.css */
  --wine: #6B1E2E;
  --wine-deep: #3D0F1A;
  --wine-light: #9B3A4D;
  --wine-tint: #F5EAED;
  --gold: #C4973B;
  --gold-access: #9E751E;
  --gold-light: #D9B870;
  --gold-tint: #FBF4E6;
  --cream: #F9F4EE;
  --cream-mid: #EDE5D8;
  --cream-dark: #DDD0BB;

  --text-dark: #1A1008;
  --text-mid: #4A3728;
  --text-light: #5E4A3C;
  --text-ghost: #8C7A6B;

  --surface: #FFFFFF;
  --border: rgba(107, 30, 46, 0.12);
  --border-gold: rgba(196, 151, 59, 0.25);

  --red: #E74C3C;
  --green: #27AE60;

  --font-d: 'Cormorant Garamond', Georgia, serif;
  --font-b: 'DM Sans', system-ui, sans-serif;

  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 10px;
}

body {
  font-family: var(--font-b);
  font-size: 14px;
  color: var(--text-mid);
  background: var(--cream-mid);
  min-height: 100vh;
  line-height: 1.55;
  padding: 32px 16px 64px;
}

main {
  width: 100%;
  display: flex;
  justify-content: center;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 44px 40px;
  width: 100%;
  max-width: 920px;
  box-shadow: 0 2px 18px rgba(61, 15, 26, 0.06);
}

.wordmark {
  font-family: var(--font-d);
  font-size: 1.4rem;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.02em;
  color: var(--wine-deep);
  margin-bottom: 18px;
  display: block;
}

h1 {
  font-family: var(--font-d);
  font-size: 2.1rem;
  font-weight: 300;
  color: var(--wine-deep);
  letter-spacing: 0.005em;
  margin-bottom: 6px;
  line-height: 1.15;
}

.subtitle {
  color: var(--text-light);
  font-size: 0.92rem;
  margin-bottom: 22px;
}

label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  color: var(--text-ghost);
  margin-bottom: 6px;
}

input[type="email"],
input[type="text"] {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font-b);
  color: var(--text-dark);
  background: var(--cream);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}

input[type="email"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(107, 30, 46, 0.12);
}

.field {
  margin-bottom: 18px;
}

button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 200px;
  padding: 12px 22px;
  background: var(--wine);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-b);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  margin-top: 8px;
}

button[type="submit"]:hover:not(:disabled) {
  background: var(--wine-deep);
}

button[type="submit"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.notice {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  margin: 16px 0 8px;
  line-height: 1.55;
}

.notice--info {
  background: var(--gold-tint);
  border: 1px solid var(--border-gold);
  color: var(--gold-access);
}

.notice--error {
  background: var(--wine-tint);
  border: 1px solid var(--wine-light);
  color: var(--wine-deep);
}

.notice--success {
  background: rgba(39, 174, 96, 0.08);
  border: 1px solid rgba(39, 174, 96, 0.4);
  color: #1c6b3a;
}

#status {
  display: none;
}

#status.visible {
  display: block;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

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

/* ── Sign-specific ──────────────────────────────────────────── */

.pdf-frame {
  width: 100%;
  height: 70vh;
  min-height: 520px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--cream);
  margin: 20px 0;
}

.sign-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 12px 0 18px;
  padding: 14px 16px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.sign-row input[type="checkbox"] {
  margin-top: 4px;
  width: 16px;
  height: 16px;
  accent-color: var(--wine);
  cursor: pointer;
}

.sign-row label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text-mid);
  margin: 0;
  cursor: pointer;
  line-height: 1.55;
}

.audit-block {
  background: var(--gold-tint);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin-top: 20px;
}

.audit-block .ok {
  font-family: var(--font-d);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--wine-deep);
  margin-bottom: 12px;
}

.audit-block .typed {
  font-family: 'Caveat', cursive;
  font-size: 28pt;
  color: var(--wine-deep);
  margin: 8px 0 14px;
  line-height: 1.1;
}

.audit-block .meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 18px;
  font-size: 0.85rem;
  color: var(--text-mid);
  margin-top: 8px;
}

.audit-block .meta .k {
  color: var(--text-ghost);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 500;
}

.audit-block .note {
  font-size: 0.78rem;
  color: var(--text-ghost);
  font-style: italic;
  margin-top: 14px;
  line-height: 1.55;
}

footer {
  margin-top: 26px;
  font-size: 0.78rem;
  color: var(--text-ghost);
  text-align: center;
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 720px) {
  body { padding: 20px 12px 48px; }
  .card { padding: 24px 20px 28px; }
  h1 { font-size: 1.6rem; }
  .pdf-frame { height: 60vh; min-height: 380px; }
  .audit-block .typed { font-size: 24pt; }
}

@media (min-width: 1200px) {
  .card { max-width: 1080px; padding: 44px 56px 52px; }
  .pdf-frame { height: 78vh; }
}
