/* ══════════════════════════════════════════════
   MemoriPress shared "warm + crafted" components
   ──────────────────────────────────────────────
   Reusable building blocks for the customer-facing
   surface (auth, account, orders, books, albums,
   wizard, legal). Loaded site-wide via base.html
   so any logged-in page can opt into them by class.

   Design language is locked from PR #96 — see
   web/static/css/landing.css for the canonical
   landing-page implementations of these patterns.
   ══════════════════════════════════════════════ */

/* ── Page container & section rhythm ─────────── */

.mp-page {
  max-width: var(--mp-container-narrow);
  margin: 0 auto;
  padding: 4rem 1.75rem 5rem;
}

.mp-page-wide {
  max-width: var(--mp-container);
  margin: 0 auto;
  padding: 4rem 1.75rem 5rem;
}

/* ── Page title — Fraunces with optional italic emphasis ── */

.mp-page-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 0.75rem;
}

.mp-page-title em {
  font-style: italic;
  font-weight: 500;
  color: var(--mp-color-accent);
  font-variation-settings: "opsz" 144;
  /* Italic Fraunces glyphs lean right; pull the next character a hair
     closer so trailing punctuation doesn't read disconnected. */
  margin-right: -0.08em;
}

.mp-page-subtitle {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 2.5rem;
  max-width: 56ch;
}

/* Eyebrow tag — small uppercase letterspacing label */
.mp-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mp-color-accent);
  margin: 0 0 1rem;
}

/* ── Cards ─────────────────────────────────── */

.mp-card {
  background: var(--mp-color-surface);
  border: 1px solid var(--mp-color-divider);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  box-shadow: 0 1px 2px rgba(42, 31, 26, 0.04);
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.mp-card-tight {
  padding: 1.25rem 1.5rem;
}

.mp-card-header {
  margin-bottom: 1.25rem;
}

.mp-card-header h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--text-primary);
  margin: 0 0 0.25rem;
}

.mp-card-header h2 em {
  font-style: italic;
  color: var(--mp-color-accent);
}

.mp-card-subtitle {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0;
}

/* ── CTAs ─────────────────────────────────── */

.mp-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: var(--mp-color-accent);
  color: #FBF7F0;
  border: none;
  border-radius: 4px;
  padding: 0.95rem 1.9rem;
  font-family: var(--font-serif);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease, box-shadow 220ms ease;
  box-shadow: 0 1px 0 rgba(42, 31, 26, 0.08);
  min-height: 0;
  line-height: 1.2;
}

.mp-cta:hover,
.mp-cta:focus-visible {
  background: var(--mp-color-accent-dark);
  color: #FBF7F0;
  text-decoration: none;
  box-shadow: 0 8px 22px -8px rgba(181, 87, 58, 0.45);
  outline: none;
}

.mp-cta-block { width: 100%; }

.mp-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--mp-color-accent);
  text-decoration: none;
  border-bottom: 1px solid var(--mp-color-accent);
  padding: 0.18rem 0;
  transition: color 180ms ease, border-color 180ms ease;
}

.mp-cta-secondary:hover {
  color: var(--mp-color-accent-dark);
  border-color: var(--mp-color-accent-dark);
  text-decoration: none;
}

.mp-cta-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--mp-color-divider);
  border-radius: 4px;
  padding: 0.85rem 1.6rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
  line-height: 1.2;
  min-height: 0;
}

.mp-cta-ghost:hover {
  border-color: var(--mp-color-accent);
  color: var(--mp-color-accent);
  text-decoration: none;
}

/* ── Form fields ─────────────────────────── */

.mp-field {
  display: block;
  margin-bottom: 1.1rem;
}

.mp-field-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  margin: 0 0 0.45rem;
}

.mp-field-input,
.mp-field input,
.mp-field select,
.mp-field textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--mp-color-surface);
  border: 1px solid var(--mp-color-divider);
  border-radius: 4px;
  padding: 0.7rem 0.9rem;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
  box-sizing: border-box;
}

.mp-field input:hover,
.mp-field select:hover,
.mp-field textarea:hover {
  border-color: #C9B79C;
}

.mp-field input:focus,
.mp-field select:focus,
.mp-field textarea:focus {
  outline: none;
  border-color: var(--mp-color-accent);
  box-shadow: 0 0 0 3px rgba(181, 87, 58, 0.18);
}

.mp-field input::placeholder,
.mp-field textarea::placeholder {
  color: #A89683;
}

.mp-field input[disabled],
.mp-field input[readonly] {
  background: var(--mp-color-surface-warm);
  color: var(--text-secondary);
  cursor: not-allowed;
}

.mp-field-help {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ── Notices (info/error/success) ─────── */

.mp-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 4px;
  border: 1px solid var(--mp-color-divider);
  background: var(--mp-color-surface-warm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 0 0 1.25rem;
}

.mp-notice-error {
  background: rgba(192, 73, 42, 0.06);
  border-color: rgba(192, 73, 42, 0.30);
  color: #7A2A14;
}

.mp-notice-success {
  background: rgba(107, 143, 92, 0.10);
  border-color: rgba(107, 143, 92, 0.35);
  color: #3E5C32;
}

/* ── Section divider — small terracotta hairline ── */

.mp-divider {
  display: block;
  width: 36px;
  height: 1px;
  background: var(--mp-color-accent);
  margin: 2rem auto;
  opacity: 0.6;
  border: none;
}

/* ── Auth-style centered card layout ──── */

.mp-auth-shell {
  min-height: calc(100vh - var(--header-height) - 4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5rem 1.5rem 4rem;
  background: var(--mp-color-bg);
}

.mp-auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--mp-color-surface);
  border: 1px solid var(--mp-color-divider);
  border-radius: 6px;
  padding: 3rem 2.75rem;
  box-shadow:
    0 1px 2px rgba(42, 31, 26, 0.04),
    0 18px 40px -24px rgba(42, 31, 26, 0.18);
}

.mp-auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
}

.mp-auth-brand svg { color: var(--mp-color-accent); }

.mp-auth-card h1 {
  font-family: var(--font-serif);
  font-size: 1.875rem;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.018em;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
}

.mp-auth-card h1 em {
  font-style: italic;
  color: var(--mp-color-accent);
  font-weight: 500;
}

.mp-auth-card .mp-auth-sub {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 2rem;
}

.mp-auth-footer {
  margin-top: 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-align: center;
}

.mp-auth-footer a {
  color: var(--mp-color-accent);
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease, color 160ms ease;
  text-decoration: none;
}

.mp-auth-footer a:hover {
  color: var(--mp-color-accent-dark);
  border-bottom-color: var(--mp-color-accent-dark);
  text-decoration: none;
}

.mp-auth-aside {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--mp-color-divider);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  text-align: center;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ══════════════════════════════════════════════
   Legal pages (privacy, terms, refund)
   ──────────────────────────────────────────────
   Generous reading column, clear hierarchy:
   Fraunces for h1/h2, italic Fraunces for h3
   subsections, Inter for body, warm tan dividers
   between sections.
   ══════════════════════════════════════════════ */

.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.legal-page h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
}

.legal-page > .text-muted,
.legal-page .legal-effective-date {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 0 0 3rem;
}

.legal-page > .text-muted::after {
  content: "";
  display: block;
  width: 36px;
  height: 1px;
  background: var(--mp-color-accent);
  margin: 1.75rem 0 0;
  opacity: 0.6;
}

.legal-page h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.012em;
  color: var(--text-primary);
  margin: 3rem 0 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--mp-color-divider);
}

.legal-page h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.legal-page h3 {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-primary);
  margin: 1.75rem 0 0.65rem;
}

.legal-page p {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-primary);
  margin: 0 0 1.1rem;
}

.legal-page ul,
.legal-page ol {
  margin: 0 0 1.25rem 1.5rem;
  padding: 0;
  font-family: var(--font-sans);
  line-height: 1.7;
}

.legal-page li {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.legal-page li::marker {
  color: var(--mp-color-accent);
}

.legal-page strong {
  font-weight: 600;
  color: var(--text-primary);
}

.legal-page a {
  color: var(--mp-color-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(181, 87, 58, 0.4);
  transition: color 160ms ease, border-color 160ms ease;
}

.legal-page a:hover {
  color: var(--mp-color-accent-dark);
  border-bottom-color: var(--mp-color-accent-dark);
  text-decoration: none;
}

.legal-page hr {
  border: none;
  border-top: 1px solid var(--mp-color-divider);
  margin: 3rem 0;
}

.legal-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
}

.legal-page th,
.legal-page td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--mp-color-divider);
  vertical-align: top;
}

.legal-page th {
  font-weight: 600;
  background: var(--mp-color-surface-warm);
}

@media (max-width: 600px) {
  .legal-page { padding: 1.5rem 1.25rem 4rem; font-size: 1rem; }
  .legal-page p { font-size: 1rem; }
  .legal-page h2 { font-size: 1.375rem; margin-top: 2.25rem; padding-top: 1.5rem; }
}

/* ══════════════════════════════════════════════
   Order / book / album lists & details
   ══════════════════════════════════════════════ */

/* Page-title for non-marketing customer pages */
.page-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2.25rem;
  max-width: 64ch;
}

.page-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-header h1 em {
  font-style: italic;
  color: var(--mp-color-accent);
  font-weight: 500;
}

.page-header p {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
}

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

@media (max-width: 600px) {
  .mp-page,
  .mp-page-wide { padding: 2.5rem 1.25rem 3.5rem; }
  .mp-card { padding: 1.5rem 1.5rem; }
  .mp-auth-shell { padding: 2.5rem 1rem 3rem; }
  .mp-auth-card { padding: 2rem 1.75rem; }
  .mp-auth-card h1 { font-size: 1.625rem; }
}
