/* Design system tokens + components for the contact feature's two screens.
   See specs/design/ for the direction, token table and component states this implements. */

:root {
  /* Sitewide dark palette — see app/static/css/base.css / specs/design/system.md.
     Namespaced to this feature's own token names rather than the shared
     --color-* custom properties, so this file still works stand-alone. */
  --color-bg: #0b132b;
  --color-surface: #1c2541;
  --color-text: #ffffff;
  --color-text-muted: #8d99ae;
  /* Translucent, not the flat #1c2541 card tone — this border sits against
     .card's own background (--color-surface, same hex) on the form inputs
     and table rows, where a flat match would render as no border at all. */
  --color-border: rgba(141, 153, 174, 0.3);
  --color-primary: #00b4d8;
  --color-primary-hover: #33c3e0;
  --color-primary-contrast: #0b132b;
  --color-accent: #00b4d8;
  --color-accent-hover: #33c3e0;
  --color-success: #7fdb9c;
  --color-success-bg: #102319;
  --color-success-border: #1e4a30;
  --color-danger: #f2a298;
  --color-danger-bg: #2b1613;
  --color-danger-border: #5c2b24;
  --color-focus-ring: #00b4d8;

  /* Same family as app/static/css/base.css --font-sans — this page should
     not read as a different font stack from the rest of the site. */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-2xl: 2rem;
  /* Matches base.css --text-3xl, for a page-title size consistent with
     about/facility/course-detail's h1. */
  --text-3xl: 2.441rem;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-10: 4rem;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.contact-feature {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-5) var(--space-10);
}

.contact-feature a {
  color: var(--color-primary);
}

/* Page header, shared by both screens */
.page-header {
  margin-bottom: var(--space-6);
}

.page-header h1 {
  font-size: var(--text-3xl);
  line-height: 1.25;
  margin: 0 0 var(--space-2);
}

.page-header p {
  color: var(--color-text-muted);
  line-height: 1.5;
  max-width: 38rem;
  margin: 0;
}

/* Alerts */
.alert {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  margin-bottom: var(--space-5);
  line-height: 1.5;
}

.alert-success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border-color: var(--color-success-border);
}

.alert-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border-color: var(--color-danger-border);
}

/* Layout: form card + details card */
.contact-layout {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 800px) {
  .contact-layout {
    grid-template-columns: 1.2fr 1fr;
  }
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
}

/* Form fields */
.contact-form {
  display: grid;
  gap: var(--space-4);
}

.field {
  display: grid;
  gap: var(--space-2);
}

.field label {
  font-size: var(--text-sm);
  font-weight: 600;
}

.field input,
.field textarea {
  font: inherit;
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-surface);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color 120ms ease;
}

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

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
  border-color: var(--color-primary);
}

.field input:disabled,
.field textarea:disabled {
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

/* Buttons — base.css's shared .btn / .btn-primary provide the sitewide
   outlined-cyan treatment (same look as the course-detail enquiry button);
   only the grid-layout and disabled-state concerns specific to this form
   are added here. */
.btn {
  justify-self: start;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* `.contact-feature a` above sets every link to the accent cyan, including
   this one — two classes here (0,2,0) so it outranks that single-class+tag
   rule (0,1,1) and the button's own text actually shows up instead of
   cyan-on-cyan. */
a.btn-accent {
  background: var(--color-accent);
  color: var(--color-primary-contrast);
}

a.btn-accent:hover:not(:disabled) {
  background: var(--color-accent-hover);
}

/* Contact details card */
.contact-details {
  display: grid;
  gap: var(--space-5);
}

.contact-details h2 {
  font-size: var(--text-lg);
  margin: 0 0 var(--space-2);
}

.contact-details p {
  margin: 0;
  line-height: 1.5;
}

.contact-map iframe {
  width: 100%;
  height: 260px;
  border: 0;
  border-radius: var(--radius-lg);
  display: block;
}

/* Enquiries table. Nested inside .card rather than combined with it, so the
   scroll container itself carries no padding — padding on an overflow:auto
   element renders inconsistently at the trailing scroll edge across browsers. */
.table-wrapper {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table th,
.table td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.table th {
  color: var(--color-text-muted);
  font-weight: 600;
}

.table tbody tr:hover {
  background: var(--color-bg);
}

.empty-state {
  text-align: center;
  color: var(--color-text-muted);
  padding: var(--space-8) var(--space-4);
}
