@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Montserrat:wght@400;500;700;800&display=swap');

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --bg-primary:        #000000;
  --bg-surface:        #0a0a0a;
  --bg-card:           #0f0f0f;
  --bg-input:          #080808;
  --accent-gold:       #CFA54B;
  --accent-gold-dim:   rgba(207,165,75,0.15);
  --accent-gold-focus: rgba(207,165,75,0.35);
  --accent-red:        #c0392b;
  --text-primary:      #ffffff;
  --text-secondary:    #a1a1a1;
  --text-muted:        #4a4a4a;
  --border-idle:       rgba(255,255,255,0.07);
  --border-hover:      rgba(207,165,75,0.25);
  --border-focus:      #CFA54B;
  --border-error:      var(--accent-red);
  --font-heading:      'Montserrat', sans-serif;
  --font-body:         'Inter', sans-serif;
  --radius:            4px;
  --max-width:         780px;
  --transition:        0.2s ease;

  /* Modern Web Guidance: accent-color syncs native controls to brand */
  accent-color: var(--accent-gold);
  color-scheme: dark;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  padding: 48px 20px 80px;
  overflow-x: hidden;
  /* Modern: text-wrap: pretty prevents orphaned words */
  text-wrap: pretty;
}

/* Custom scrollbar (Modern Web Guidance: scrollbar-color) */
::-webkit-scrollbar        { width: 6px; }
::-webkit-scrollbar-track  { background: var(--bg-primary); }
::-webkit-scrollbar-thumb  { background: #1e1e1e; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-gold); }
scrollbar-color: #1e1e1e var(--bg-primary);
scrollbar-width: thin;

/* ============================================================
   LAYOUT
   ============================================================ */
.container { max-width: var(--max-width); margin: 0 auto; }

/* ============================================================
   HEADER
   ============================================================ */
header {
  text-align: center;
  margin-bottom: 56px;
}

.brand-logo {
  max-width: 190px;
  height: auto;
  margin-bottom: 28px;
  /* Force white on black background */
  filter: brightness(0) invert(1);
}

h1 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(22px, 4vw, 32px);
  letter-spacing: -0.5px;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 10px;
  /* Modern: text-wrap: balance keeps heading lines even */
  text-wrap: balance;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 520px;
  margin: 0 auto;
  font-weight: 400;
  text-wrap: pretty;
}

/* Thin gold divider under header */
.header-divider {
  width: 48px;
  height: 2px;
  background: var(--accent-gold);
  margin: 20px auto 0;
  border-radius: 1px;
  opacity: 0.7;
}

/* ============================================================
   STATUS ALERTS
   Modern Web Guidance: animate-element-entry-exit
   Uses @starting-style so alerts animate IN when shown
   ============================================================ */
.status-msg {
  padding: 20px 24px;
  border-radius: var(--radius);
  margin-bottom: 32px;
  font-size: 14px;
  border-left: 3px solid transparent;
  line-height: 1.6;

  /* Entry animation via @starting-style */
  transition: opacity var(--transition), transform var(--transition);
  opacity: 1;
  transform: translateY(0);
}

@starting-style {
  .status-msg { opacity: 0; transform: translateY(-8px); }
}

.status-msg.hidden {
  display: none;
}

#success-message {
  background: rgba(207,165,75,0.05);
  border-color: var(--accent-gold);
  color: #e0c97a;
}

#success-message strong { color: var(--text-primary); }

#error-message {
  background: rgba(192,57,43,0.06);
  border-color: var(--accent-red);
  color: #e07070;
}

/* ============================================================
   FORM SECTIONS
   ============================================================ */
.section {
  background: var(--bg-card);
  border: 1px solid var(--border-idle);
  border-radius: var(--radius);
  padding: 36px 40px;
  margin-bottom: 24px;
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

/* Subtle gold left accent line on hover */
.section::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 2px;
  height: 100%;
  background: var(--accent-gold);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s ease;
}

.section:hover { border-color: var(--border-hover); }
.section:hover::before { transform: scaleY(1); }

h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--accent-gold);
  text-transform: uppercase;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-idle);
}

/* ============================================================
   FORM GROUPS & LABELS
   ============================================================ */
.form-group { margin-bottom: 22px; }
.form-group:last-child { margin-bottom: 0; }

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.5;
}

.label-required::after {
  content: " *";
  color: var(--accent-gold);
  font-weight: 700;
}

/* ============================================================
   INPUTS & TEXTAREAS
   Modern Web Guidance:
   - field-sizing: content  (auto-grow textareas)
   - :user-invalid          (validate ONLY after interaction)
   ============================================================ */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-idle);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  /* Modern: field-sizing lets textareas grow with content */
  field-sizing: content;
  min-height: 44px;
}

textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.6;
}

/* Hover state */
input[type="text"]:hover,
input[type="email"]:hover,
input[type="tel"]:hover,
textarea:hover {
  border-color: var(--border-hover);
  background: #0d0d0d;
}

/* Focus state */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus {
  border-color: var(--border-focus);
  background: #0d0d0d;
  box-shadow: 0 0 0 3px var(--accent-gold-focus);
}

/* Modern Web Guidance: :user-invalid — only shows red AFTER user interacts */
input:user-invalid,
textarea:user-invalid {
  border-color: var(--border-error);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.2);
}

/* Placeholder colour */
input::placeholder,
textarea::placeholder { color: var(--text-muted); font-size: 13px; }

/* Modern Web Guidance: :autofill highlight in brand colours */
input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #111 inset;
  -webkit-text-fill-color: var(--text-primary);
  caret-color: var(--text-primary);
  border-color: var(--accent-gold-dim);
}

/* ============================================================
   TOOLS TABLE
   ============================================================ */
.table-container { overflow-x: auto; margin-top: 14px; }

table { width: 100%; border-collapse: collapse; }

th, td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-idle);
  text-align: left;
  font-size: 13px;
}

th {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-idle);
}

td:first-child { font-weight: 500; color: var(--text-secondary); width: 35%; }

table input[type="text"] {
  padding: 8px 10px;
  background: transparent;
  border-color: transparent;
  font-size: 13px;
  min-height: auto;
}

table input[type="text"]:hover { background: var(--bg-input); border-color: var(--border-hover); }
table input[type="text"]:focus { background: var(--bg-input); border-color: var(--border-focus); }

/* ============================================================
   SUBMIT BUTTON
   ============================================================ */
.submit-container { text-align: center; margin-top: 36px; }

button[type="submit"] {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #000;
  background: var(--accent-gold);
  border: none;
  border-radius: var(--radius);
  padding: 16px 48px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

/* Shimmer sweep on hover */
button[type="submit"]::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transition: left 0.45s ease;
}

button[type="submit"]:hover {
  background: #dbb05a;
  box-shadow: 0 4px 20px rgba(207,165,75,0.35);
}

button[type="submit"]:hover::after { left: 160%; }

button[type="submit"]:active { transform: scale(0.98); }

button[type="submit"]:disabled {
  background: #1a1a1a;
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

button[type="submit"]:disabled::after { display: none; }

/* ============================================================
   SPINNER
   ============================================================ */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0,0,0,0.15);
  border-left-color: #000;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}

.spinner.hidden { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   PROGRESS INDICATOR (section counter)
   ============================================================ */
.section-badge {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-gold);
  background: var(--accent-gold-dim);
  border: 1px solid rgba(207,165,75,0.2);
  border-radius: 2px;
  padding: 2px 8px;
  margin-bottom: 14px;
  text-transform: uppercase;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  body { padding: 24px 12px 60px; }

  .section { padding: 24px 18px; }

  h1 { font-size: 20px; }
  h2 { font-size: 10px; }

  td:first-child { width: auto; }

  button[type="submit"] { width: 100%; padding: 16px 24px; }
}

/* Modern Web Guidance: prefers-reduced-motion — disable animations for accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
