/*
 * Public pages outside the Shopify admin (`/` login and `/email/unsubscribe`): Polaris and App
 * Bridge are not loaded there, so this one small sheet gives them the app's look. Colours are the
 * email template tokens (app/lib/email/layout.ts). Served as a same-origin file so the strict
 * unsubscribe CSP only needs `style-src 'self'` (no inline styles).
 */
:root {
  --pp-ink: #303030;
  --pp-muted: #616161;
  --pp-page: #f1f1f1;
  --pp-card: #ffffff;
  --pp-line: #e3e3e3;
  --pp-field: #8a8a8a;
  --pp-focus: #005bd3;
  --pp-critical: #8e0b21;
  color-scheme: light;
}

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

html,
body {
  margin: 0;
}

body {
  background: var(--pp-page);
  color: var(--pp-ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  text-size-adjust: 100%;
}

.pp-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
}

.pp-card {
  width: 100%;
  max-width: 440px;
  min-width: 0;
  padding: 32px;
  background: var(--pp-card);
  border: 1px solid var(--pp-line);
  border-radius: 12px;
  overflow-wrap: anywhere;
}

.pp-brand {
  margin: 0 0 8px;
  color: var(--pp-muted);
  font-size: 13px;
  font-weight: 600;
}

.pp-title {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
}

.pp-text {
  margin: 0 0 24px;
  color: var(--pp-muted);
}

.pp-text:last-child {
  margin-bottom: 0;
}

.pp-form {
  display: grid;
  gap: 16px;
  margin: 0;
}

.pp-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.pp-label {
  font-weight: 600;
}

.pp-input {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  color: inherit;
  font: inherit;
  background: var(--pp-card);
  border: 1px solid var(--pp-field);
  border-radius: 8px;
}

.pp-help {
  color: var(--pp-muted);
  font-size: 13px;
}

.pp-help[role="alert"] {
  color: var(--pp-critical);
}

.pp-button {
  width: 100%;
  min-height: 44px;
  padding: 10px 20px;
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  background: var(--pp-ink);
  border: 1px solid var(--pp-ink);
  border-radius: 8px;
  cursor: pointer;
}

.pp-button:disabled {
  cursor: default;
  opacity: 0.6;
}

.pp-card a {
  color: var(--pp-focus);
}

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

/* Phone widths (320 to 480 px): card from the top, smaller padding, never wider than the screen. */
@media (max-width: 480px) {
  .pp-page {
    align-items: flex-start;
    padding: 16px;
  }

  .pp-card {
    padding: 20px;
  }

  .pp-title {
    font-size: 20px;
  }
}
