/* ============================================================
   alerts.css — Phase 4.

   Narrow, single-column form pages (create / manage / edit /
   expired). No new visual vocabulary: surfaces, borders,
   radii, buttons, and typography all reference tokens.css +
   components.css. This file only composes the layout.
   ============================================================ */

.alerts-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-7) var(--space-5) var(--space-10);
}

.alerts-hero {
  margin-bottom: var(--space-7);
}
.alerts-hero h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-3);
  color: var(--text-primary);
}
.alerts-hero .sub {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.5;
}

.alerts-banner {
  background: var(--warning-bg);
  color: var(--warning-fg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-6);
  font-size: 14px;
  line-height: 1.4;
}

.alerts-form {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--elev-1);
  padding: var(--space-7);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.alerts-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.alerts-field > label,
.alerts-field > .alerts-label-text {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

.alerts-field input[type="text"],
.alerts-field input[type="email"],
.alerts-field input[type="password"],
.alerts-field select {
  font: inherit;
  font-size: 15px;
  height: 40px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--surface-raised);
  color: var(--text-primary);
  width: 100%;
  box-sizing: border-box;
}
.alerts-field input[type="text"]:focus,
.alerts-field input[type="email"]:focus,
.alerts-field input[type="password"]:focus,
.alerts-field select:focus {
  outline: 3px solid color-mix(in srgb, var(--brand-500) 50%, transparent);
  outline-offset: 1px;
  border-color: var(--brand-500);
}

/* Chrome / Safari autofill ignore standard background-color rules
 * — they paint a yellow background on autofilled fields that the
 * normal :focus / :not(:focus) rules can't override. The
 * inset-box-shadow trick paints over the autofill yellow with our
 * --surface-raised, and -webkit-text-fill-color forces the input
 * text back to --text-primary. R10 slice 2 PR 3a fix — landed
 * here rather than auth.css so contact-form email autofill (and
 * any future form using .alerts-field) gets the same treatment. */
.alerts-field input:-webkit-autofill,
.alerts-field input:-webkit-autofill:hover,
.alerts-field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--surface-raised) inset;
  -webkit-text-fill-color: var(--text-primary);
  caret-color: var(--text-primary);
  transition: background-color 5000s ease-in-out 0s;
}

.alerts-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  align-items: center;
}
.alerts-unit {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 13px;
}

.alerts-radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
}
.alerts-radio {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 14.5px;
  color: var(--text-primary);
  cursor: pointer;
}
.alerts-radio input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-600);
  margin: 0;
}

.alerts-help {
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.alerts-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin-top: var(--space-2);
}

.alerts-empty {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--elev-1);
  padding: var(--space-7);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.alerts-empty p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.5;
}

.alerts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.alerts-row {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--elev-1);
  padding: var(--space-5) var(--space-5) var(--space-5);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-4);
  align-items: center;
}
.alerts-row-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.alerts-row-title {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.alerts-row-title a {
  color: inherit;
  text-decoration: none;
}
.alerts-row-title a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.alerts-row-meta {
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.4;
}
.alerts-row-meta .mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-feature-settings: "tnum";
  color: var(--text-primary);
  margin-left: 4px;
}
.alerts-row-actions {
  display: flex;
  gap: var(--space-3);
  flex-shrink: 0;
}

.alerts-footnote {
  margin-top: var(--space-6);
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
}

.alerts-danger,
.alerts-danger-btn {
  color: var(--danger-fg);
}
.alerts-danger-btn {
  background: var(--danger-fg);
  color: var(--text-on-brand);
  border-color: var(--danger-fg);
}
.alerts-danger-btn:hover:not(:disabled):not([aria-disabled="true"]) {
  background: #5c1220;
  border-color: #5c1220;
}

@media (max-width: 559.98px) {
  .alerts-wrap { padding: var(--space-5) var(--space-4) calc(var(--tabbar-height) + var(--space-7)); }
  .alerts-form { padding: var(--space-5); }
  .alerts-empty { padding: var(--space-5); }
  .alerts-row { grid-template-columns: 1fr; }
  .alerts-row-actions { justify-content: flex-start; }
  /* iOS zoom guard: inputs ≥16px don't trigger a zoom-to-focus. */
  .alerts-field input[type="text"],
  .alerts-field select { font-size: 16px; }
}
