/*
 * Shared page shell for maple's browser pages (plan 002 Phase 7, Center Court):
 * the public pages in src/public/ and the legacy magic-link redirect pages in
 * auth.controller.ts.
 *
 * - Navy header band with the combined logo (full color on its white backing,
 *   used as is), a white card on the warm page background
 * - Status as a tinted panel, never a colored stripe; no emoji or glyph icons
 * - Colors follow the app's KC tokens (walnut kc-theme.css) and the email layout;
 *   dark values follow the app's dark theme. The band stays navy in dark mode
 */

:root {
  color-scheme: light dark;

  --kc-page-bg: #faf9f7;
  --kc-page-surface: #ffffff;
  --kc-page-text: #1a202c;
  --kc-page-text-secondary: #4b5563;
  --kc-page-text-muted: #6b7280;
  --kc-page-border: #e5e7eb;
  --kc-page-band: #0b2f6b;
  --kc-page-ink: #0b2f6b;
  --kc-page-focus: rgba(11, 47, 107, 0.25);

  --kc-page-field-bg: #ffffff;
  --kc-page-field-border: #6b7280;

  --kc-page-danger: #b91c1c;
  --kc-page-danger-hover: #991b1b;
  --kc-page-on-danger: #ffffff;
  --kc-page-disabled: #9ca3af;

  /* Tinted panels: navy, red, clay and green fills with matching ink */
  --kc-page-info-bg: #f0f3f6;
  --kc-page-info-text: #1a202c;
  --kc-page-warning-bg: #fdf2f2;
  --kc-page-warning-text: #b91c1c;
  --kc-page-notice-bg: #fbf0e3;
  --kc-page-notice-text: #8f541a;
  --kc-page-success-bg: #ecfdf5;
  --kc-page-success-text: #065f46;
  --kc-page-plain-bg: #f3f4f6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --kc-page-bg: #0f172a;
    --kc-page-surface: #111827;
    --kc-page-text: #f9fafb;
    --kc-page-text-secondary: #d1d5db;
    --kc-page-text-muted: #9ca3af;
    --kc-page-border: #374151;
    --kc-page-ink: #9db9ee;
    --kc-page-focus: rgba(157, 185, 238, 0.35);

    --kc-page-field-bg: #1f2937;
    --kc-page-field-border: #9ca3af;

    --kc-page-danger: #dc2626;
    --kc-page-danger-hover: #b91c1c;
    --kc-page-disabled: #4b5563;

    --kc-page-info-bg: #16243f;
    --kc-page-info-text: #e5e7eb;
    --kc-page-warning-bg: #342532;
    --kc-page-warning-text: #fca5a5;
    --kc-page-notice-bg: #272015;
    --kc-page-notice-text: #e8b06a;
    --kc-page-success-bg: #11291f;
    --kc-page-success-text: #6ee7b7;
    --kc-page-plain-bg: #1f2937;
  }
}

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

.kc-page {
  font-family: 'Figtree', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--kc-page-text-secondary);
  background-color: var(--kc-page-bg);
  padding: 40px 20px;
  overflow-wrap: anywhere;
}

.kc-page__card {
  display: block;
  max-width: 600px;
  margin: 0 auto;
  background-color: var(--kc-page-surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.kc-page__card--wide {
  max-width: 800px;
}

.kc-page__band {
  background-color: var(--kc-page-band);
  padding: 24px;
  text-align: center;
}

.kc-page__logo {
  display: block;
  margin: 0 auto;
  width: 240px;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.kc-page__content {
  padding: 32px 40px 8px;
}

.kc-page__title {
  font-family: 'Outfit', 'Figtree', system-ui, sans-serif;
  font-weight: 700;
  font-size: 28px;
  line-height: 1.25;
  color: var(--kc-page-text);
  margin-bottom: 16px;
  text-align: center;
}

.kc-page__lead {
  text-align: center;
  margin-bottom: 24px;
}

.kc-page__meta {
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--kc-page-text-muted);
  margin-bottom: 24px;
}

.kc-page__content h2 {
  font-family: 'Outfit', 'Figtree', system-ui, sans-serif;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.3;
  color: var(--kc-page-text);
  margin: 36px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--kc-page-border);
}

.kc-page__content h3 {
  font-family: 'Outfit', 'Figtree', system-ui, sans-serif;
  font-weight: 600;
  font-size: 18px;
  line-height: 1.3;
  color: var(--kc-page-text);
  margin: 24px 0 12px;
}

.kc-page__content p,
.kc-page__content ul,
.kc-page__content ol {
  margin-bottom: 16px;
}

.kc-page__content ul,
.kc-page__content ol {
  margin-left: 24px;
}

.kc-page__content li {
  margin-bottom: 8px;
}

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

.kc-page a {
  color: var(--kc-page-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.kc-page a:focus-visible,
.kc-page button:focus-visible,
.kc-page input:focus-visible {
  outline: 2px solid var(--kc-page-ink);
  outline-offset: 2px;
}

/* Status panels: a tinted fill, no stripe. Text inside inherits the panel ink */
.kc-page__panel {
  padding: 16px;
  margin: 24px 0;
  border-radius: 8px;
  font-size: 15px;
  background-color: var(--kc-page-plain-bg);
  color: var(--kc-page-text-secondary);
}

.kc-page__panel p {
  margin-bottom: 8px;
}

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

.kc-page__panel strong {
  color: inherit;
}

.kc-page__panel--info {
  background-color: var(--kc-page-info-bg);
  color: var(--kc-page-info-text);
}

.kc-page__panel--warning {
  background-color: var(--kc-page-warning-bg);
  color: var(--kc-page-warning-text);
}

.kc-page__panel--notice {
  background-color: var(--kc-page-notice-bg);
  color: var(--kc-page-notice-text);
}

.kc-page__panel--success {
  background-color: var(--kc-page-success-bg);
  color: var(--kc-page-success-text);
}

.kc-page__panel--center {
  text-align: center;
}

.kc-page__figure {
  display: block;
  margin-top: 8px;
  font-family: 'Outfit', 'Figtree', system-ui, sans-serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--kc-page-text);
}

/* Forms */
.kc-page__field {
  margin-bottom: 20px;
}

.kc-page__label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--kc-page-text);
}

.kc-page__input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--kc-page-field-border);
  border-radius: 8px;
  font: inherit;
  color: var(--kc-page-text);
  background-color: var(--kc-page-field-bg);
}

.kc-page__input:focus {
  outline: none;
  border-color: var(--kc-page-ink);
  box-shadow: 0 0 0 3px var(--kc-page-focus);
}

.kc-page__button {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 14px 32px;
  border: none;
  border-radius: 8px;
  font-family: 'Outfit', 'Figtree', system-ui, sans-serif;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
}

.kc-page__button--danger {
  background-color: var(--kc-page-danger);
  color: var(--kc-page-on-danger);
}

.kc-page__button--danger:hover {
  background-color: var(--kc-page-danger-hover);
}

.kc-page__button:active {
  transform: translateY(1px);
}

.kc-page__button:disabled {
  background-color: var(--kc-page-disabled);
  cursor: not-allowed;
  transform: none;
}

/* Hidden until delete-account.js adds .is-shown */
.kc-page__message {
  display: none;
}

.kc-page__message.is-shown {
  display: block;
}

/* Link list: plain rows on the neutral fill */
.kc-page__links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0 24px;
}

.kc-page__link-row {
  display: block;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--kc-page-border);
  background-color: var(--kc-page-plain-bg);
  text-decoration: none;
}

.kc-page a.kc-page__link-row {
  text-decoration: none;
}

.kc-page__link-row:hover {
  border-color: var(--kc-page-ink);
}

.kc-page__link-row strong {
  display: block;
  color: var(--kc-page-ink);
}

.kc-page__link-row span {
  display: block;
  font-size: 14px;
  color: var(--kc-page-text-secondary);
}

.kc-page__actions {
  text-align: center;
  margin: 24px 0;
}

.kc-page__footer {
  margin: 24px 40px 0;
  padding: 20px 0 32px;
  border-top: 1px solid var(--kc-page-border);
  text-align: center;
  font-size: 14px;
  color: var(--kc-page-text-muted);
}

@media (max-width: 640px) {
  .kc-page {
    padding: 16px 12px;
  }

  .kc-page__band {
    padding: 20px 16px;
  }

  .kc-page__logo {
    width: 200px;
  }

  .kc-page__content {
    padding: 24px 20px 8px;
  }

  .kc-page__footer {
    margin: 16px 20px 0;
  }

  .kc-page__title {
    font-size: 24px;
  }

  .kc-page__content h2 {
    font-size: 20px;
  }
}
