/* ============================================================
   contact-form.css — BPP Institute Static Site
   ============================================================
   Standalone styles for the static contact form on /contact/.
   These are intentionally written in plain, readable CSS with
   no Tailwind dependencies, so a developer can edit them directly.

   Colour tokens match the site's design system:
     --bpp-ink            : primary dark text
     --bpp-bg-form        : section background (light brand-060 teal)
     --bpp-accent         : interactive / button colour
     --bpp-focus-ring     : keyboard focus outline
   ============================================================ */

/* ── Custom properties (fallbacks align to the Tailwind palette) ── */
:root {
  --bpp-ink: #1a1a1a;
  --bpp-ink-muted: #4a4a4a;
  --bpp-bg-form: #e6f4f4;
  /* light-brand-060 approximate */
  --bpp-border: #c0c8cc;
  --bpp-bg-input: #ffffff;
  --bpp-accent: #1a1a1a;
  /* dark submit button */
  --bpp-accent-hover: #333333;
  --bpp-focus-ring: #0070f3;
  --bpp-radius-input: 6px;
  --bpp-radius-btn: 999px;
  --bpp-success-bg: #d1fae5;
  --bpp-success-text: #065f46;
  --bpp-success-border: #6ee7b7;
  --bpp-error-bg: #fee2e2;
  --bpp-error-text: #991b1b;
  --bpp-error-border: #fca5a5;
}

/* ── Section wrapper ────────────────────────────────────────────── */
/*
   The section sits inside <div class="bg-light-brand-060 ...">
   which the Tailwind CSS already handles.  We only need to add
   vertical padding to the section itself.
*/
#request-callback {
  padding-top: 5rem;
  padding-bottom: 5rem;
  /* Override the Next.js min-h placeholder classes */
  min-height: 0 !important;
}

/* ── Two-column grid: intro left, form right ────────────────────── */
.contact-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 768px) {
  .contact-form-grid {
    grid-template-columns: 1fr 1.5fr;
    gap: 5rem;
    align-items: start;
  }
}

/* ── Intro copy ─────────────────────────────────────────────────── */
.contact-form-intro {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-form-intro h2 {
  margin: 0;
}

.contact-form-intro p {
  margin: 0;
  color: var(--bpp-ink-muted);
  line-height: 1.6;
}

.contact-form-intro a {
  color: var(--bpp-ink);
  text-decoration: underline;
}

/* ── Form layout ────────────────────────────────────────────────── */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ── Individual field wrapper ────────────────────────────────────── */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-field label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--bpp-ink);
}

/* Required star */
.form-field label span[aria-hidden] {
  color: #c0392b;
  margin-left: 0.125rem;
}

/* ── Text inputs and textarea ────────────────────────────────────── */
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--bpp-border);
  border-radius: var(--bpp-radius-input);
  background-color: var(--bpp-bg-input);
  color: var(--bpp-ink);
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}

.form-field select {
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%231a1a1a' viewBox='0 0 24 24'%3E%3Cpath d='m20.857 7.801-.805-.805a.488.488 0 0 0-.691 0L12 14.341 4.639 6.996a.488.488 0 0 0-.69 0l-.806.805a.488.488 0 0 0 0 .691l8.512 8.511c.19.191.5.191.69 0l8.512-8.51a.488.488 0 0 0 0-.692'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  cursor: pointer;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: 2px solid var(--bpp-focus-ring);
  outline-offset: 2px;
  border-color: var(--bpp-focus-ring);
  box-shadow: 0 0 0 3px rgba(0, 112, 243, 0.15);
}

.form-field textarea {
  resize: vertical;
  min-height: 130px;
}

/* ── Two-column row (first / last name) ─────────────────────────── */
.form-row--two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 480px) {
  .form-row--two-col {
    grid-template-columns: 1fr;
  }
}

/* ── Privacy / consent fieldset ─────────────────────────────────── */
.form-privacy {
  border: none;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.form-privacy legend {
  font-size: 0.8rem;
  color: var(--bpp-ink-muted);
  line-height: 1.6;
  margin-bottom: 0.75rem;
  padding: 0;
  float: left;
  /* fix Firefox legend layout */
  width: 100%;
}

.form-privacy legend a {
  color: var(--bpp-ink);
}

.form-privacy legend+* {
  clear: left;
}

.form-radio {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--bpp-ink);
  cursor: pointer;
  user-select: none;
  margin-top: 0.5rem;
}

.form-radio input[type="radio"] {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  accent-color: var(--bpp-ink);
  cursor: pointer;
}

/* ── Feedback banner ─────────────────────────────────────────────── */
.form-feedback {
  padding: 1rem 1.25rem;
  border-radius: var(--bpp-radius-input);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
}

.form-feedback--success {
  background-color: var(--bpp-success-bg);
  color: var(--bpp-success-text);
  border: 1px solid var(--bpp-success-border);
}

.form-feedback--error {
  background-color: var(--bpp-error-bg);
  color: var(--bpp-error-text);
  border: 1px solid var(--bpp-error-border);
}

/* ── Submit button ───────────────────────────────────────────────── */
.form-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  background-color: var(--bpp-accent);
  color: #ffffff;
  border: none;
  border-radius: var(--bpp-radius-btn);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
  align-self: flex-start;
  text-decoration: none;
  line-height: 1;
}

.form-submit:hover {
  background-color: var(--bpp-accent-hover);
}

.form-submit:focus-visible {
  outline: 2px solid var(--bpp-focus-ring);
  outline-offset: 3px;
}

.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-submit svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
}
