/* contact.css
   Purpose: Page-scoped styles for contact form.
   Methodology:
   - Scoped under `.contact-page` to avoid overriding global tokens/components.
   - Do NOT redefine root variables (e.g. --primary); rely on them and provide safe fallbacks.
   - Keep layout, spacing, focus, and small visual tweaks here; let main.css handle global buttons, base typography, etc.
*/

/* Page container scope */
.contact-page {
  max-width: 760px;
  margin: 32px auto;
  padding: 20px;
  word-break: break-word;
  overflow-wrap: break-word;
  /* do not set font-family or base color here; inherit from main.css */
}

/* Header */
.contact-page h1 {
  margin: 0 0 8px 0;
  font-size: 1.6rem;
  line-height: 1.08;
}
.contact-page .lead {
  margin: 0 0 20px 0;
  color: var(--muted, #6b7280);
  font-size: 1rem;
}

/* Form layout */
.contact-page .contact-form {
  display: block;
  width: 100%;
  background: var(--form-surface, transparent);
  border-radius: 10px;
  padding: 0; /* keep form visually integrated */
  margin-top: 6px;
}

/* form-row groups fields and their labels */
.contact-page .form-row {
  margin-bottom: 14px;
}

/* labels */
.contact-page .form-label {
  display: block;
  font-weight: 600;
  margin: 0 0 6px 0;
  color: var(--label-color, inherit);
  font-size: 0.95rem;
}

/* controls: keep them full width but lightweight so global .form-control rules still win if present */
.contact-page .form-control {
  box-sizing: border-box;
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--input-border, rgba(0,0,0,0.12));
  background: var(--input-bg, #ffffff);
  color: var(--input-foreground, inherit);
  font-size: 1rem;
  line-height: 1.3;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
  resize: vertical;
  min-height: 40px;
}

/* textarea specific */
.contact-page textarea.form-control {
  min-height: 120px;
  padding-top: 10px;
  padding-bottom: 10px;
}

/* subtle inner shadow for focus to improve visibility but not override site tokens */
.contact-page .form-control:focus {
  border-color: var(--focus-ring, rgba(13,110,253,0.6));
  box-shadow: 0 0 0 3px rgba(13,110,253,0.06);
  outline: none;
}

/* disabled/read-only states - rely on global variables when available */
.contact-page .form-control[disabled],
.contact-page .form-control[readonly] {
  opacity: 0.7;
  cursor: not-allowed;
}

/* form actions */
.contact-page .form-actions {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  align-items: center;
}

/* button: try to reuse global .btn styles, add a small page-specific modifier */
.contact-page .contact-submit {
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--primary, #0d6efd);
  color: var(--btn-foreground, #ffffff);
  transition: filter 120ms ease, transform 80ms ease, box-shadow 120ms ease;
}

/* slightly stronger hover/focus affordance; rely on main tokens where possible */
.contact-page .contact-submit:hover,
.contact-page .contact-submit:focus {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(2,6,23,0.06);
  outline: none;
  filter: brightness(0.98);
}

/* small link-like cancel or auxiliary text (if you add later) */
.contact-page .aux {
  font-size: 0.95rem;
  color: var(--muted, #6b7280);
}

/* validation states (non-invasive) */
.contact-page .form-control.is-invalid {
  border-color: var(--danger, #dc3545);
  box-shadow: 0 0 0 3px rgba(220,53,69,0.06);
}
.contact-page .form-help {
  margin-top: 6px;
  font-size: 0.88rem;
  color: var(--muted, #6b7280);
}

/* responsive */
@media (max-width: 520px) {
  .contact-page {
    padding: 14px;
    margin: 18px auto;
  }
  .contact-page h1 { font-size: 1.3rem; }
  .contact-page .form-actions { justify-content: stretch; }
  .contact-page .contact-submit { width: 100%; text-align: center; }
}

/* print: reduce chrome and remove interactions */
@media print {
  .contact-page .contact-submit,
  .contact-page .form-actions { display: none !important; }
  .contact-page .form-control { border: 1px solid #ddd; background: transparent; }
}

/* accessibility: visible focus for interactive elements without clobbering global focus tokens */
.contact-page a:focus, .contact-page button:focus, .contact-page input:focus, .contact-page textarea:focus {
  outline: 3px solid rgba(15,118,110,0.12);
  outline-offset: 2px;
}

/* small helper for visually-hidden text (if not already in utilities) */
.contact-page .sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* keep this file focused; global resets, variables and base components live in main.css */
