/* ==========================================================================
   TJS Consultation Form - Form-Specific Styles
   Brand alignment with thejapanschool.com. The shared common.css is used by
   other forms, so every brand override lives here instead.
   ========================================================================== */

/* --- Brand tokens (thejapanschool.com palette) ---
   The second block re-points the variable names that common.css consumes,
   so shared components pick up the brand colors without editing common.css. */
:root {
  --color-indigo-blue: #224874;
  --color-navy-blue: #00325e;
  --color-sky-blue: #66b1c3;
  --color-sax-blue: #79a4bd;
  --color-ice-blue: #ecf2f6;
  --color-frost-white: #f1f6f8;
  --color-mist-blue: #e4edf2;
  --color-cool-gray: #dfe2e7;
  --color-crimson: #c32c1f;
  --color-ocher: #d5753c;
  --color-terracotta: #c45453;
  --font-heading: 'Oswald', 'Noto Sans JP', sans-serif;

  /* Overrides for variables defined in ../shared/css/common.css */
  --color-primary: #36608f;
  --color-accent: #36608f;
  --color-accent-hover: #224874;
  --color-bg: #f1f6f8;
  --color-error: #c32c1f;
  --color-border: #dfe2e7;
  --color-border-focus: #36608f;
  --font-family: 'Noto Sans JP', system-ui, -apple-system, sans-serif;
}

/* --- Header ---
   The official logo is dark (near-black lettering + navy mark), so the header
   switches from the solid navy band to a white band with a brand rule. */
.form-header {
  background-color: var(--color-white);
  border-bottom: 4px solid var(--color-primary);
  padding: 20px 20px 14px;
}

.form-header h1 {
  margin-bottom: 6px;
  line-height: 0;
}

.form-header .header-logo {
  display: inline-block;
  width: min(300px, 78vw);
  height: auto;
}

.form-header p {
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  opacity: 1;
}

/* --- Heading font (Oswald, per brand site) --- */
.step-content h2,
.confirmation-section h3,
#thank-you h2 {
  font-family: var(--font-heading);
  letter-spacing: 0.02em;
}

/* Prevent a single word being orphaned on the last line (e.g. "us.") */
#thank-you p {
  text-wrap: pretty;
}

/* --- Notice Box (visa support disclaimer) ---
   Warm ocher tone so the caution stands out against the blue page tone
   while still sitting inside the brand's accent palette. */
.notice-box {
  background: #fbf1e8;
  border: 1px solid #eccfb4;
  border-left: 4px solid var(--color-ocher);
  padding: 16px;
  margin-bottom: 24px;
  border-radius: 4px;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #6e4423;
}

.notice-box p {
  margin: 0;
}

.notice-box strong {
  color: #a04918;
}

/* --- Terms Box (informational, stays in the cool brand tones) --- */
.terms-box {
  background: var(--color-ice-blue);
  border-left: 4px solid var(--color-sax-blue);
  padding: 16px;
  margin: 16px 0;
  border-radius: 4px;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-navy-blue);
}

.terms-box p {
  margin-bottom: 8px;
}

.terms-box p:last-child {
  margin-bottom: 0;
}

/* --- Step section headings --- */
.step-content h2 {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--color-navy-blue);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-primary);
}

/* --- One-line reassurance under step headings (keeps momentum visible) --- */
.step-intro {
  margin: -8px 0 20px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-text-light);
}

/* --- Second choice toggle: keep it inline-left, not a full-width box row --- */
.toggle-second {
  display: inline-flex;
}

/* --- Date Input --- */
input[type="date"] {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font-family: var(--font-family);
  font-size: 1rem;
  color: var(--color-text);
  background-color: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

input[type="date"]:focus {
  border-color: var(--color-border-focus);
}

/* --- Focus rings ---
   common.css hard-codes its old blue in rgba() shadows, so the brand blue
   (#36608f) is re-applied here for every focusable control. */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(54, 96, 143, 0.15);
}

.radio-label input[type="radio"]:focus-visible + .radio-custom,
.checkbox-label input[type="checkbox"]:focus-visible + .checkbox-custom {
  box-shadow: 0 0 0 3px rgba(54, 96, 143, 0.25);
}

.radio-label:hover,
.checkbox-label:hover {
  background-color: rgba(54, 96, 143, 0.07);
  border-color: rgba(54, 96, 143, 0.15);
}

.form-steps .step.active .step-number {
  box-shadow: 0 2px 8px rgba(54, 96, 143, 0.3);
}

.btn-next,
.btn-submit {
  box-shadow: 0 2px 8px rgba(54, 96, 143, 0.25);
}

.btn-next:hover,
.btn-submit:hover {
  box-shadow: 0 4px 12px rgba(54, 96, 143, 0.3);
}

/* --- Error state (crimson per brand palette) --- */
.has-error input[type="date"] {
  border-color: var(--color-error);
}

.has-error input:focus,
.has-error select:focus,
.has-error textarea:focus,
.has-error input[type="date"]:focus {
  box-shadow: 0 0 0 3px rgba(195, 44, 31, 0.12);
}

/* --- Lives-in-Japan radio: error state on the custom radio ring --- */
.has-error .radio-custom {
  border-color: var(--color-error);
}

/* --- Online-only note under the school select (shown when living abroad) --- */
.school-online-note {
  margin-top: 6px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text-light);
}

/* --- Confirmation section adjustments --- */
.confirmation-section {
  margin-bottom: 24px;
}

.confirmation-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--color-border);
}

.confirmation-table th {
  background-color: var(--color-frost-white);
}

/* --- Radio fieldset (a11y) ---
   Wrapping radio groups in <fieldset>/<legend> gives assistive tech a single
   labelled control. Strip the UA chrome (1990s "inset" border + odd legend
   positioning) so layout matches the rest of the form. */
.radio-fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.radio-fieldset > legend {
  display: block;
  padding: 0;
  margin-bottom: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
}

/* common.css only matches label.required; mirror the asterisk for legends. */
.radio-fieldset > legend.required::after {
  content: " *";
  color: var(--color-error);
}

/* Hide the focus ring on programmatically-focused step headings; the visible
   focus signal is the active step indicator at the top, and a permanent
   outline on h2 would feel like a stray artifact. */
.step-content h2:focus {
  outline: none;
}

/* flatpickr calendar header: the global rule in ../shared/css/common.css
   (input/select { display:block; width:100%; min-height:48px; padding:12px 14px; ... })
   also hits flatpickr's month <select> and year <input type="number">, making them
   48px tall inside the 34px header and clipping the text. Scope-reset them here so
   flatpickr's own stylesheet controls their layout. */
.flatpickr-calendar .flatpickr-monthDropdown-months,
.flatpickr-calendar .numInput.cur-year {
  display: inline-block;
  width: auto;
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background-color: transparent;
  box-shadow: none;
  transition: none;
}
