/*
 * form.css - public warranty form styling.
 *
 * Adopts the admin app.css design system (--wb-* tokens, slate palette, sharp
 * corners, matching inputs/buttons/focus) so the public form is visually
 * consistent with the rest of the tool. Self-contained: defines its own tokens
 * (like login.css), so it renders without app.css present.
 */

:root {
  --wb-red: #DC1E24;
  --wb-red-dark: #B81820;
  --wb-primary: #0f172a;
  --wb-primary-hover: #1e293b;
  --wb-primary-active: #020617;
  --wb-text: #0f172a;
  --wb-text-muted: #64748b;
  --wb-text-label: #334155;
  --wb-text-subtle: #94a3b8;
  --wb-bg: #ffffff;
  --wb-bg-subtle: #f8fafc;
  --wb-disabled-bg: #f1f5f9;
  --wb-border: #e2e8f0;
  --wb-border-strong: #cbd5e1;
  --wb-error-bg: #fef2f2;
  --wb-error-text: #991b1b;
  --wb-error-border: #fecaca;
  --wb-success-bg: #ecfdf5;
  --wb-success-text: #065f46;
  --wb-success-border: #a7f3d0;
  --wb-radius: 0px;
  --wb-shadow-focus: 0 0 0 3px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  max-width: 720px;
  margin: 2rem auto;
  padding: 0 1rem;
  color: var(--wb-text);
  background: var(--wb-bg-subtle);
  font-size: 0.95rem;
  line-height: 1.5;
}

h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--wb-text);
}

/* Maintenance page (shown for a known but disabled/paused country) */
body.maintenance {
  max-width: 560px;
  margin: 4rem auto;
  text-align: center;
}
.maint-box {
  background: var(--wb-bg);
  border: 1px solid var(--wb-border);
  border-top: 3px solid var(--wb-red);
  border-radius: var(--wb-radius);
  padding: 2.5rem 2rem;
}
.maint-icon { font-size: 3rem; line-height: 1; color: var(--wb-text-subtle); }
.maint-box h1 { font-size: 1.35rem; margin: 0.8rem 0 0.6rem; color: var(--wb-text); }
.maint-box p { color: var(--wb-text-muted); line-height: 1.6; margin: 0; }

/* Country picker (shown when no valid country is selected) */
body.picker { max-width: 520px; text-align: center; }
.picker-lead { color: var(--wb-text-muted); }
.countries { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1.5rem; }
.countries a {
  display: block;
  padding: 0.85rem;
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--wb-red);
  border: 1px solid var(--wb-red);
  border-radius: var(--wb-radius);
  transition: background 0.15s ease, color 0.15s ease;
}
.countries a:hover { background: var(--wb-red); color: #fff; }

/* Type switch (windows / tiles) */
.switch { display: flex; gap: 0.5rem; margin: 1rem 0 1.5rem; }
.switch button {
  flex: 1;
  padding: 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--wb-border-strong);
  background: var(--wb-bg);
  color: var(--wb-text-label);
  border-radius: var(--wb-radius);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.switch button:hover { border-color: var(--wb-red); color: var(--wb-red); }
.switch button.active {
  background: var(--wb-primary);
  border-color: var(--wb-primary);
  color: #fff;
}

/* Labels + fields */
label {
  display: block;
  margin: 0.7rem 0 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--wb-text-label);
}
.req::after { content: " *"; color: var(--wb-red); }

input, select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  font-size: 0.9rem;
  border: 1px solid var(--wb-border-strong);
  border-radius: var(--wb-radius);
  background: var(--wb-bg);
  color: var(--wb-text);
}
input:focus, select:focus {
  outline: none;
  border-color: var(--wb-primary);
  box-shadow: var(--wb-shadow-focus);
}

/* Two-column grid for paired fields */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.full { grid-column: 1 / -1; }

.hint { font-size: 0.8rem; color: var(--wb-text-muted); margin: 0.2rem 0 0; }
.disclaimer { font-size: 0.85rem; color: var(--wb-text-label); margin: 0.4rem 0 0; line-height: 1.4; }

.privacy-note { font-size: 0.8rem; color: var(--wb-text-muted); line-height: 1.5; margin: 1rem 0; }
.privacy-note a { color: var(--wb-red); }

/* Consent checkbox row */
.check { display: flex; gap: 0.5rem; align-items: flex-start; margin: 1.2rem 0; }
.check input { width: auto; margin-top: 0.25rem; }

/* Submit */
button.submit {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  background: var(--wb-primary);
  color: #fff;
  border: 1px solid var(--wb-primary);
  border-radius: var(--wb-radius);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
button.submit:hover { background: var(--wb-red); border-color: var(--wb-red); }
button.submit:active { background: var(--wb-primary-active); }
button.submit:focus-visible { outline: none; box-shadow: var(--wb-shadow-focus); }
button.submit:disabled { background: var(--wb-disabled-bg); border-color: var(--wb-border-strong); color: var(--wb-text-subtle); cursor: not-allowed; }

/* Honeypot: off-screen, not display:none (bots skip those) */
.hp { position: absolute; left: -5000px; top: -5000px; width: 1px; height: 1px; overflow: hidden; }

/* Result banner */
#result { margin-top: 1.5rem; padding: 1rem; border-radius: var(--wb-radius); display: none; }
#result.ok { background: var(--wb-success-bg); border: 1px solid var(--wb-success-border); color: var(--wb-success-text); }
#result.err { background: var(--wb-error-bg); border: 1px solid var(--wb-error-border); color: var(--wb-error-text); }

/* Modals */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 50;
}
.modal .box {
  background: var(--wb-bg);
  padding: 2rem;
  border-radius: var(--wb-radius);
  text-align: center;
  max-width: 440px;
  width: 100%;
  border-top: 3px solid var(--wb-red);
}
.modal .icon { font-size: 3rem; line-height: 1; }
.modal h2 { color: var(--wb-red); font-size: 1.5rem; margin: 0.6rem 0 0.4rem; }
.modal p { font-size: 1.05rem; line-height: 1.5; margin: 0.4rem 0 1.2rem; color: var(--wb-text); }
.modal button {
  padding: 0.7rem 1.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--wb-primary);
  color: #fff;
  border: 1px solid var(--wb-primary);
  border-radius: var(--wb-radius);
  cursor: pointer;
}
.modal button:hover { background: var(--wb-red); }
.modal .num { font-size: 2.2rem; font-weight: 700; color: var(--wb-red); margin: 0.4rem 0; }

/* Two-column grid collapses on narrow screens */
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
}