/* Grant application form styles — pairs with existing styles.css */

.apply-elignote { margin: 1.25rem 0 0; font-size: .95rem; color: var(--ink-soft); }
.apply-elignote strong { color: var(--blue-deep); }

.apply-headercta { display: flex; gap: .75rem; margin-top: 1.5rem; flex-wrap: wrap; }
.btn--sm { padding: .55rem 1rem; font-size: .88rem; }
/* Ensure hidden buttons stay hidden even with .btn's inline-flex display */
[hidden] { display: none !important; }

.apply-formwrap { padding-top: clamp(2rem, 4vw, 3rem); }

/* Resume box */
.apply-resume {
  background: #fff;
  border: 1px solid var(--border, #e5dfd4);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  max-width: 560px;
  margin: 0 auto 2rem;
  box-shadow: 0 2px 12px rgba(27,77,138,.06);
}
.apply-resume h3 { margin: 0 0 .5rem; color: var(--blue-deep); font-size: 1.2rem; }
.apply-resume p { color: var(--ink-soft); font-size: .95rem; margin: 0 0 1rem; }
.apply-resume label span { display: block; font-size: .85rem; font-weight: 600; color: var(--ink); margin-bottom: .35rem; }
.apply-resume input {
  width: 100%; padding: .7rem .85rem; border: 1px solid #d4cdbe;
  border-radius: 8px; font: inherit; font-family: 'Inter', system-ui, sans-serif;
}
.apply-resume__btns { display: flex; gap: .5rem; margin-top: .85rem; }
.apply-resume__err { color: #a12c2c; font-size: .88rem; margin: .75rem 0 0; }

/* Progress bar */
.apply-progress {
  max-width: 820px; margin: 0 auto 2rem;
}
.apply-progress__bar {
  height: 6px; background: #ece5d5; border-radius: 999px; overflow: hidden;
}
.apply-progress__fill {
  height: 100%; background: linear-gradient(90deg, var(--blue-deep), var(--blue-sky, #62b5e5));
  border-radius: 999px; width: 10%; transition: width .35s ease;
}
.apply-progress__label {
  margin: .65rem 0 0; text-align: center; font-size: .9rem;
  color: var(--ink-soft); font-family: 'Inter', sans-serif;
}
.apply-progress__label span { color: var(--blue-deep); font-weight: 600; }

/* Form container */
.apply-form {
  max-width: 820px; margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border, #e5dfd4);
  border-radius: 18px;
  padding: clamp(1.5rem, 3vw, 2.75rem);
  box-shadow: 0 4px 24px rgba(27,77,138,.05);
}

.apply-step-panel {
  display: none;
  border: 0; padding: 0; margin: 0;
}
.apply-step-panel.is-active { display: block; }

.apply-step-panel > legend {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 600;
  color: var(--blue-deep);
  padding: 0; margin-bottom: 1.5rem;
  line-height: 1.2;
}

.apply-hint {
  color: var(--ink-soft); font-size: .95rem;
  margin: -.5rem 0 1.25rem;
  line-height: 1.55;
}

/* Grid layout */
.apply-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem 1.25rem;
}
.apply-field { display: flex; flex-direction: column; }
.apply-field--wide { grid-column: 1 / -1; }
.apply-field > span {
  font-size: .87rem; font-weight: 600;
  color: var(--ink); margin-bottom: .4rem;
  font-family: 'Inter', sans-serif;
}
.req { color: #c33; font-weight: 700; }

.apply-field input,
.apply-field textarea,
.apply-field select,
.apply-form input[type="text"],
.apply-form input[type="email"],
.apply-form input[type="tel"],
.apply-form input[type="url"],
.apply-form input[type="number"],
.apply-form input[type="date"],
.apply-form textarea,
.apply-form select {
  width: 100%;
  padding: .7rem .85rem;
  border: 1px solid #d4cdbe;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .98rem;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.apply-field input:focus,
.apply-field textarea:focus,
.apply-field select:focus,
.apply-form input:focus,
.apply-form textarea:focus,
.apply-form select:focus {
  outline: none;
  border-color: var(--blue-deep);
  box-shadow: 0 0 0 3px rgba(27,77,138,.15);
}
.apply-field textarea { resize: vertical; min-height: 100px; }
/* Only show red borders after a validation attempt (JS adds .show-errors to the step panel) */
.apply-step-panel.show-errors .apply-field input:invalid,
.apply-step-panel.show-errors .apply-field textarea:invalid,
.apply-step-panel.show-errors .apply-field select:invalid { border-color: #c33; }
.apply-step-panel.show-errors .apply-field input.invalid,
.apply-step-panel.show-errors .apply-field textarea.invalid { border-color: #c33; }

/* Checkboxes / radios */
.apply-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .5rem .85rem;
  margin-bottom: 1.25rem;
}
.check {
  display: flex; align-items: flex-start; gap: .55rem;
  padding: .6rem .75rem;
  border: 1px solid #e2dccc;
  border-radius: 8px;
  cursor: pointer;
  font-size: .93rem;
  transition: background .15s, border-color .15s;
  background: #fdfaf3;
}
.check:hover { border-color: var(--blue-mid, #3b82c4); background: #fff; }
.check input { accent-color: var(--blue-deep); margin-top: 2px; width: 16px; height: 16px; flex-shrink: 0; }
.check input:checked ~ span { color: var(--blue-deep); font-weight: 600; }
.check--stack { display: flex; margin-bottom: 1rem; }

.apply-subgroup {
  border: 0; padding: 0; margin: 0 0 1.25rem;
}
.apply-subgroup > legend {
  font-size: .87rem; font-weight: 600; color: var(--ink);
  padding: 0; margin-bottom: .5rem;
  font-family: 'Inter', sans-serif;
}

/* File upload */
.apply-upload {
  display: block; cursor: pointer;
  margin: 1rem 0 1rem;
}
.apply-upload input[type="file"] { display: none; }
.apply-upload__box {
  display: block;
  border: 2px dashed #c8beac;
  border-radius: 12px;
  padding: 2rem 1rem;
  text-align: center;
  background: #fdfaf3;
  transition: border-color .15s, background .15s;
}
.apply-upload__box strong { display: block; color: var(--blue-deep); font-size: 1rem; margin-bottom: .25rem; }
.apply-upload__box span { color: var(--ink-soft); font-size: .9rem; }
.apply-upload:hover .apply-upload__box { border-color: var(--blue-deep); background: #fff; }
.apply-upload__box.is-drag { border-color: var(--blue-deep); background: #eef4fb; }

.apply-filelist {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: .5rem;
}
.apply-filelist li {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: .65rem .85rem;
  background: #f7f2e5;
  border: 1px solid #e2dccc;
  border-radius: 8px;
  font-size: .93rem;
}
.apply-filelist li .file-status { color: var(--ink-soft); font-size: .82rem; }
.apply-filelist li .file-status.is-done { color: #437a22; font-weight: 600; }
.apply-filelist li .file-status.is-err { color: #c33; font-weight: 600; }
.apply-filelist button {
  background: none; border: 0; color: #c33; cursor: pointer;
  font-size: .85rem; padding: .25rem .5rem;
}

.apply-doclist {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--ink-soft);
  font-size: .93rem;
  line-height: 1.7;
}

/* Consent */
.apply-consent {
  background: #f7f2e5;
  border-left: 3px solid var(--blue-deep);
  padding: 1rem 1.25rem;
  border-radius: 6px;
  margin-bottom: 1.25rem;
  font-size: .95rem;
  line-height: 1.6;
  color: var(--ink);
}
.apply-consent p { margin: 0 0 .5rem; }
.apply-consent ul { margin: .5rem 0 0; padding-left: 1.25rem; }
.apply-consent li { margin-bottom: .3rem; }

/* Nav */
.apply-nav {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  margin-top: 2rem; padding-top: 1.5rem;
  border-top: 1px solid #ece5d5;
  flex-wrap: wrap;
}
.apply-nav__right { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Messages */
.apply-savedmsg {
  margin: 1rem 0 0; padding: .85rem 1rem;
  background: #e8f4d9; border: 1px solid #b8d99a;
  border-radius: 8px;
  color: #2d5a12; font-size: .93rem;
}
.apply-errmsg {
  margin: 1rem 0 0; padding: .85rem 1rem;
  background: #fbe5e5; border: 1px solid #e6a5a5;
  border-radius: 8px;
  color: #8a1c1c; font-size: .93rem;
}

/* Success panel */
.apply-success {
  max-width: 720px; margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border, #e5dfd4);
  border-radius: 18px;
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
  box-shadow: 0 4px 24px rgba(27,77,138,.05);
}
.apply-success__check { display: inline-flex; color: #437a22; margin-bottom: 1rem; }
.apply-success h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  color: var(--blue-deep);
  margin: 0 0 1rem;
}
.apply-success p { color: var(--ink); line-height: 1.65; font-size: 1.02rem; max-width: 520px; margin: 0 auto 1rem; }
.apply-success__ref {
  display: inline-block; padding: .5rem 1rem;
  background: #f7f2e5; border-radius: 8px;
  font-family: 'Inter', monospace; font-size: .9rem;
  color: var(--ink-soft);
}
.apply-success__ref strong { color: var(--blue-deep); font-family: 'Inter', monospace; letter-spacing: .5px; }
.apply-success__btns {
  display: flex; justify-content: center; gap: .75rem; margin-top: 1.5rem; flex-wrap: wrap;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Responsive */
@media (max-width: 640px) {
  .apply-grid { grid-template-columns: 1fr; }
  .apply-checks { grid-template-columns: 1fr; }
  .apply-nav { flex-direction: column-reverse; align-items: stretch; }
  .apply-nav__right { flex-direction: column-reverse; }
  .apply-nav__right .btn { width: 100%; }
  .apply-nav > button { width: 100%; }
}
