:root {
  color-scheme: dark;
  --bg: #0f1012;
  --panel: #181a1d;
  --panel-hover: #202226;
  --line: #2e3035;
  --gold: #e9bb5d;
  --gold-hover: #f5cd84;
  --gold-glow: rgba(233, 187, 93, 0.2);
  --muted: #a2a5ab;
  --text: #f5f5f7;
  --error: #e06c75;
  --error-bg: #2b181b;
  --error-border: #64282f;
  --success: #98c379;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

a {
  color: var(--gold);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.portal-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* Header */
.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
  margin-bottom: 30px;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.portal-brand img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px rgba(233, 187, 93, 0.4);
}

.portal-brand-title {
  font-weight: 750;
  font-size: 18px;
  letter-spacing: 1px;
  color: var(--text);
  line-height: 1.2;
}

.portal-brand-subtitle {
  font-size: 11px;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 3px;
}

.portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #242017;
  border: 1px solid #735d2f;
  color: var(--gold);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

/* Hero text */
.portal-hero {
  margin-bottom: 28px;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
}

h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.8px;
  margin: 0 0 10px;
}

p.lead {
  color: var(--muted);
  font-size: 15px;
  margin: 0;
  max-width: 720px;
}

/* Panel & Form Sections */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px;
  margin: 20px 0;
}

.form-section {
  margin-bottom: 30px;
}

.form-section:last-of-type {
  margin-bottom: 16px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #282a2f;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Even 2-column Grid */
.formgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.full {
  grid-column: 1 / -1;
}

/* Balanced Form Field */
.form-field {
  display: flex;
  flex-direction: column;
}

.field-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 4px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: #dfdfdf;
  line-height: 1.35;
}

.field-label .req {
  color: var(--gold);
  margin-left: 2px;
}

.field-sub {
  font-size: 11px;
  color: var(--muted);
  font-weight: normal;
  margin-top: 3px;
  min-height: 16px; /* Keeps left & right headers equal height so inputs line up perfectly */
  line-height: 1.4;
}

/* Form Inputs */
input, select, textarea {
  display: block;
  width: 100%;
  background: #101113;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 14px;
  font: 14px system-ui, -apple-system, sans-serif;
  min-height: 44px;
  margin-top: auto; /* Aligns all inputs at the bottom of the grid row */
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a2a5ab' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 15px;
  padding-right: 38px;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* Consent & Accordion Cards */
.consent-card {
  background: #111215;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.consent-card select {
  margin-top: 8px;
}

details {
  margin-top: 8px;
  background: #15171a;
  border: 1px solid #282a2f;
  border-radius: 6px;
  padding: 8px 12px;
}

summary {
  cursor: pointer;
  color: var(--gold);
  font-size: 12px;
  font-weight: 550;
}

.question-text {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-wrap;
  margin-top: 8px;
}

/* Checkboxes */
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  cursor: pointer;
  margin: 18px 0;
  color: #e2e4e8;
  font-weight: normal;
  line-height: 1.5;
}

.check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 2px 0 0;
  accent-color: var(--gold);
  cursor: pointer;
  flex-shrink: 0;
}

/* Buttons */
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  color: #16120b;
  font: 700 14px system-ui, -apple-system, sans-serif;
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 14px 28px;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.15s, transform 0.05s;
}

button:hover, .button:hover {
  background: var(--gold-hover);
  text-decoration: none;
}

button:active {
  transform: translateY(1px);
}

.button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid #4a4d53;
}

.button.secondary:hover {
  background: #25272a;
}

.btn-submit {
  width: 100%;
  margin-top: 16px;
  font-size: 16px;
  padding: 16px;
}

/* Alerts */
.notice {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 22px;
  font-size: 13px;
  line-height: 1.5;
}

.notice.error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: #f7a3a9;
}

.notice.info {
  background: #17242e;
  border: 1px solid #29475c;
  color: #92c5de;
}

.honeypot {
  display: none !important;
}

/* Confirmation Page */
.card-thanks {
  text-align: center;
  max-width: 600px;
  margin: 20px auto;
  padding: 44px 32px;
}

.icon-check {
  width: 72px;
  height: 72px;
  background: #1c2b1e;
  border: 2px solid #3d6842;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: var(--success);
  margin: 0 auto 20px;
}

.next-steps {
  text-align: left;
  background: #121316;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  margin: 26px 0;
}

.next-steps h3 {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.next-steps ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

/* Footer */
.portal-footer {
  border-top: 1px solid var(--line);
  margin-top: 50px;
  padding-top: 24px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* =========================================================
   MOBILE RESPONSIVENESS & TOUCH OPTIMIZATION
   ========================================================= */
@media (max-width: 768px) {
  .portal-container {
    padding: 16px 14px 45px;
  }

  .portal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 16px;
    margin-bottom: 20px;
  }

  .portal-brand img {
    width: 48px;
    height: 48px;
  }

  .portal-brand-title {
    font-size: 16px;
  }

  .portal-badge {
    font-size: 11px;
    padding: 5px 12px;
  }

  h1 {
    font-size: 25px;
    letter-spacing: -0.5px;
  }

  p.lead {
    font-size: 14px;
  }

  .panel {
    padding: 20px 16px;
    border-radius: 12px;
    margin: 16px 0;
  }

  /* Collapse 2 columns into 1 clean column on mobile */
  .formgrid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .full {
    grid-column: 1 !important;
  }

  /* Inputs optimized for mobile typing and touch */
  input, select, textarea {
    font-size: 16px !important; /* 16px prevents iOS Safari auto-zoom on focus */
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 8px;
  }

  textarea {
    min-height: 90px;
  }

  .field-sub {
    min-height: 0; /* Reset spacer on mobile stacked layout */
  }

  .consent-card {
    padding: 14px;
  }

  .btn-submit {
    min-height: 52px;
    font-size: 16px;
    font-weight: 700;
  }

  .card-thanks {
    padding: 30px 18px;
  }

  .portal-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 35px;
  }
}
