/* AmeriGate Capital - /apply. Uses the tokens from styles.css. */
.apply-hero {
  background:
    radial-gradient(ellipse 55% 90% at 100% 0%, rgba(198, 163, 106, 0.16), transparent 55%),
    linear-gradient(180deg, #12243d 0%, var(--navy) 55%, var(--navy-deep) 100%);
  color: var(--paper);
  padding: 3.5rem 0 6.5rem;
}
.apply-hero .eyebrow { color: var(--gold); }
.apply-hero h1 {
  color: var(--paper);
  font-size: clamp(2.2rem, 4.4vw, 3.5rem);
  margin: 0.3rem 0 0.9rem;
  text-wrap: balance;
}
.apply-hero .subhead { max-width: 40rem; }

.apply-body { padding: 0 0 5rem; }
.apply-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20rem;
  gap: 2rem;
  align-items: start;
  margin-top: -4.25rem;
}

.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: 4px;
  box-shadow: 0 24px 48px -28px rgba(14, 28, 51, 0.45), 0 2px 6px rgba(14, 28, 51, 0.06);
  padding: 2.25rem 2.25rem 2rem;
}

.group { border: 0; margin: 0 0 2.1rem; padding: 0; min-width: 0; }
.group legend {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  width: 100%;
  padding: 0 0 0.7rem;
  margin-bottom: 1.15rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--navy);
}
.group legend .num {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold-deep);
}

.row { display: grid; gap: 1.1rem; margin-bottom: 1.1rem; }
.row.two { grid-template-columns: 1fr 1fr; }
.field { min-width: 0; }
.field > label,
.doc-title {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
}
.req { color: var(--gold-deep); margin-left: 0.1rem; }
.opt {
  margin-left: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

input[type="text"], input[type="tel"], input[type="email"], select {
  width: 100%;
  min-height: 3.1rem;
  padding: 0.7rem 0.9rem;
  background: #fff;
  color: var(--ink);
  border: 1px solid #c9bfab;
  border-radius: 3px;
  font: 400 1rem/1.3 var(--sans);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
input::placeholder { color: #8a93a3; }
input:hover, select:hover { border-color: #a99d86; }
input:focus, select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(198, 163, 106, 0.4);
}
.select-wrap { position: relative; }
.select-wrap::after {
  content: "";
  position: absolute;
  right: 1.1rem;
  top: 50%;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--navy);
  border-bottom: 2px solid var(--navy);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
select { padding-right: 2.6rem; cursor: pointer; }
select:invalid { color: #8a93a3; }
select option { color: var(--ink); }

.is-invalid input:not([type="checkbox"]), .is-invalid select { border-color: #a63a2b; }
.err { display: none; margin-top: 0.4rem; font-size: 0.88rem; color: #a63a2b; }
.is-invalid > .err, .is-invalid .err { display: block; }

.group-note {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin: -0.2rem 0 1.5rem;
  padding: 0.85rem 1rem;
  background: var(--paper);
  border-left: 3px solid var(--gold);
  font-size: 0.93rem;
  color: var(--muted);
  line-height: 1.5;
}
.group-note svg { width: 20px; height: 20px; flex: none; margin-top: 0.1rem; color: var(--navy); }

.doc { margin-bottom: 1.75rem; }
.doc-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.2rem 1rem; margin-bottom: 0.55rem; }
.doc-head .doc-title { margin: 0; }
.doc-hint { font-size: 0.85rem; color: var(--muted); }

.callout {
  display: flex;
  gap: 1rem;
  margin: 0 0 0.9rem;
  padding: 1.15rem 1.2rem;
  background: linear-gradient(180deg, #fbf6ea 0%, #f6eedb 100%);
  border: 1px solid #e3d3ac;
  border-left: 4px solid var(--gold);
  border-radius: 3px;
}
.callout-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--navy);
  color: var(--gold);
  border-radius: 50%;
}
.callout-icon svg { width: 1.25rem; height: 1.25rem; }
.callout-body { min-width: 0; }
.callout-title { font-family: var(--serif); font-size: 1.15rem; color: var(--navy); line-height: 1.25; }
.callout-lead { margin-top: 0.2rem; font-size: 0.93rem; color: var(--muted); }
.callout-steps {
  margin: 0.85rem 0 1.05rem;
  padding-left: 1.35rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink);
}
.callout-steps li { padding-left: 0.3rem; margin-bottom: 0.5rem; }
.callout-steps li:last-child { margin-bottom: 0; }
.callout-steps li::marker { color: var(--gold-deep); font-weight: 700; }
.callout-steps strong { color: var(--navy); font-weight: 700; }
.callout-steps .warn { color: #a63a2b; font-weight: 700; }
.callout-btn { margin-top: 0.15rem; }
.callout-btn[aria-disabled="true"] {
  background: #d9cdb2;
  color: #6b6350;
  pointer-events: none;
  cursor: default;
}

.drop { position: relative; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.drop-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 4.6rem;
  padding: 1rem;
  background: #fff;
  border: 1.5px dashed #bfae88;
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.98rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.drop-label svg { width: 1.5rem; height: 1.5rem; color: var(--gold-deep); flex: none; }
.drop-label strong { color: var(--navy); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 0.2em; }
.drop-label:hover, .drop.is-over .drop-label { background: #fbf8f0; border-color: var(--gold-deep); }
.file-input:focus-visible + .drop-label { outline: 2px solid var(--gold-deep); outline-offset: 3px; }
.is-invalid .drop-label { border-color: #a63a2b; }

.files { list-style: none; margin: 0; padding: 0; }
.files:not(:empty) { margin-top: 0.6rem; }
.files li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.4rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 0.92rem;
}
.files .ext {
  flex: none;
  min-width: 2.4rem;
  padding: 0.15rem 0.35rem;
  background: var(--navy);
  color: var(--gold);
  border-radius: 2px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}
.files .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.files .size { flex: none; color: var(--muted); font-size: 0.82rem; }
.files .rm {
  flex: none;
  width: 2rem; height: 2rem;
  border: 0; background: transparent; border-radius: 50%;
  color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.files .rm:hover { background: #eadfc9; color: var(--navy); }

.consent { margin: 0.4rem 0 1.6rem; }
.check { display: flex; gap: 0.8rem; align-items: flex-start; font-size: 0.93rem; color: var(--muted); line-height: 1.5; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box {
  flex: none;
  width: 1.4rem; height: 1.4rem; margin-top: 0.1rem;
  background: #fff; border: 1.5px solid #a99d86; border-radius: 3px;
  display: grid; place-items: center;
  transition: background 0.15s, border-color 0.15s;
}
.check .box::after {
  content: ""; width: 0.38rem; height: 0.7rem;
  border-right: 2px solid var(--navy); border-bottom: 2px solid var(--navy);
  transform: rotate(40deg) translate(-1px, -1px); opacity: 0;
}
.check input:checked + .box { background: var(--gold); border-color: var(--gold-deep); }
.check input:checked + .box::after { opacity: 1; }
.check input:focus-visible + .box { outline: 2px solid var(--gold-deep); outline-offset: 3px; }
.is-invalid .check .box { border-color: #a63a2b; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.submit { width: 100%; }
.submit[disabled] { opacity: 0.65; cursor: progress; }
.fine-print { margin-top: 0.9rem; text-align: center; font-size: 0.85rem; color: var(--muted); }

.progress { margin-bottom: 1.1rem; }
.progress .bar { height: 6px; background: #e9e1d0; border-radius: 3px; overflow: hidden; }
.progress .bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); transition: width 0.2s; }
.progress p { margin-top: 0.45rem; font-size: 0.9rem; color: var(--muted); }

.alert { margin-bottom: 1.5rem; padding: 0.9rem 1.1rem; background: #fbeeea; border: 1px solid #e6bfb6; border-left: 4px solid #a63a2b; border-radius: 3px; color: #7d2a1e; font-size: 0.95rem; }

.success { text-align: center; padding: 2.5rem 0.5rem 1.5rem; }
.success-mark { display: grid; place-items: center; width: 4rem; height: 4rem; margin: 0 auto 1.25rem; background: var(--navy); color: var(--gold); border-radius: 50%; }
.success-mark svg { width: 1.9rem; height: 1.9rem; }
.success h2 { font-size: 2rem; margin-bottom: 0.75rem; }
.success p { max-width: 30rem; margin: 0 auto 1.1rem; color: var(--muted); }
.success .btn { margin-top: 0.6rem; }
.success-ref { font-size: 0.85rem; }

.side-card {
  position: sticky;
  top: calc(var(--header) + 1.25rem);
  background: var(--navy);
  color: var(--paper);
  padding: 1.8rem 1.6rem;
  border-radius: 4px;
  box-shadow: 0 24px 48px -28px rgba(14, 28, 51, 0.6);
}
.side-eyebrow { margin-bottom: 0.9rem; color: var(--gold); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.side-steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.side-steps li { position: relative; padding: 0 0 1.1rem 2.6rem; counter-increment: s; }
.side-steps li:last-child { padding-bottom: 0; }
.side-steps li::before {
  content: counter(s);
  position: absolute; left: 0; top: 0;
  width: 1.8rem; height: 1.8rem; display: grid; place-items: center;
  border: 1px solid var(--gold); border-radius: 50%;
  color: var(--gold); font-family: var(--serif); font-size: 0.95rem;
}
.side-steps li:not(:last-child)::after { content: ""; position: absolute; left: 0.9rem; top: 2rem; bottom: 0.2rem; width: 1px; background: rgba(198, 163, 106, 0.4); }
.side-steps strong { display: block; font-weight: 600; }
.side-steps span { display: block; color: #cfd6e2; font-size: 0.92rem; line-height: 1.45; }
.side-rule { height: 1px; margin: 1.5rem 0; background: rgba(198, 163, 106, 0.35); }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { position: relative; padding-left: 1.5rem; margin-bottom: 0.45rem; font-size: 0.95rem; color: #e7e1d6; }
.side-list li::before { content: ""; position: absolute; left: 0.1rem; top: 0.45rem; width: 0.7rem; height: 0.4rem; border-left: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(-45deg); }
.side-help { font-size: 0.9rem; color: #cfd6e2; }
.side-help a { color: var(--paper); overflow-wrap: anywhere; }
.side-help a:hover { color: var(--gold); }

@media (max-width: 920px) {
  .apply-grid { grid-template-columns: 1fr; margin-top: -4rem; }
  .side-card { position: static; order: 2; }
}
@media (max-width: 640px) {
  .apply-hero { padding: 2.25rem 0 5.5rem; }
  .form-card { padding: 1.5rem 1.15rem 1.4rem; }
  .row.two { grid-template-columns: 1fr; gap: 1.1rem; }
  .group legend { font-size: 1.3rem; }
  .callout { padding: 1rem; gap: 0.8rem; }
  .callout-icon { width: 2.1rem; height: 2.1rem; }
  .callout-btn { width: 100%; }
  .files .size { display: none; }
}
@media (prefers-reduced-motion: reduce) { .progress .bar span, input, select, .drop-label { transition: none; } }

.field > label.check { display: flex; margin-bottom: 0; font-size: 0.93rem; font-weight: 400; color: var(--muted); }
.field > label.check a { color: var(--navy); }
.success:focus { outline: none; }
