/**
 * apply-form.css — StartupApplyForm frontend styles
 * Scoped to .ncoe-apply-form.
 *
 * Fields use native element + class selectors with !important because
 * Bootstrap 5 (loaded via ncoe_theme/css/plugins.css, which runs after
 * this module CSS) sets form-control {background:#fff} at higher load order.
 */

/* ── Layout grid (CSS Grid — no Bootstrap negative-margin overflow) ─────── */

.apply-row {
  display: grid;
  column-gap: 24px;
  margin-bottom: 22px;
  width: 100%;
}

.apply-row.cols-6-6 { grid-template-columns: 1fr 1fr; }
.apply-row.cols-12  { grid-template-columns: 1fr; }

@media (max-width: 767px) {
  .apply-row.cols-6-6 { grid-template-columns: 1fr; }
}

.ncoe-apply-form .form-item {
  width: 100%;
  margin-bottom: 0;
}

/* ── Section wrapper & spacing ──────────────────────────────────────────── */

.ncoe-apply-form .apply-section {
  margin-bottom: 44px;
}

/* ── Section headings ───────────────────────────────────────────────────── */

.apply-section-title {
  font-family: 'Barlow', sans-serif !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 3px !important;
  text-transform: uppercase !important;
  color: #fff !important;
  padding-bottom: 14px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  margin-bottom: 28px !important;
  position: relative !important;
}

.apply-section-title::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 36px;
  height: 2px;
  background: #efb53e;
}

.apply-section-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.38);
  margin-top: -18px;
  margin-bottom: 20px;
  letter-spacing: 0.2px;
}

/* ── Labels — target both Drupal 10 (form-label) and legacy (form-item__label) */

.ncoe-apply-form label.form-label,
.ncoe-apply-form label.form-item__label,
.ncoe-apply-form .form-item label {
  display: block !important;
  font-family: 'Barlow', sans-serif !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 1.8px !important;
  text-transform: uppercase !important;
  color: rgba(255, 255, 255, 0.9) !important;
  margin-bottom: 9px !important;
  line-height: 1.4 !important;
}

/* Required star for section titles (containers have no label element) */
.apply-required-star {
  color: #efb53e;
  font-size: 14px;
  font-weight: 700;
  margin-left: 2px;
  letter-spacing: 0;
  text-transform: none;
}

/* Required asterisk — stable9 template adds class="form-required" to <label>, no <abbr> rendered.
   Must use ::after pseudo-element to inject the visible * marker. */
.ncoe-apply-form label.form-required::after,
.ncoe-apply-form label.js-form-required::after {
  content: ' *' !important;
  color: #efb53e !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  margin-left: 2px !important;
}

/* ── All text inputs, textarea, select — override Bootstrap !important ──── */

.ncoe-apply-form input[type="text"],
.ncoe-apply-form input[type="email"],
.ncoe-apply-form input[type="url"],
.ncoe-apply-form input[type="tel"],
.ncoe-apply-form input[type="number"],
.ncoe-apply-form input[type="search"],
.ncoe-apply-form textarea,
.ncoe-apply-form select {
  background-color: transparent !important;
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.55) !important;
  border-radius: 8px !important;
  color: #fff !important;
  padding: 13px 16px !important;
  font-family: 'Barlow', sans-serif !important;
  font-size: 15px !important;
  line-height: 1.5 !important;
  transition: border-color .35s !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  outline: none !important;
}

.ncoe-apply-form input[type="text"]:focus,
.ncoe-apply-form input[type="email"]:focus,
.ncoe-apply-form input[type="url"]:focus,
.ncoe-apply-form input[type="tel"]:focus,
.ncoe-apply-form textarea:focus,
.ncoe-apply-form select:focus {
  background-color: transparent !important;
  border-color: rgba(255, 255, 255, 0.7) !important;
  color: #fff !important;
  box-shadow: none !important;
  outline: none !important;
}

.ncoe-apply-form input::placeholder,
.ncoe-apply-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.28) !important;
}

/* ── Select — white chevron arrow ───────────────────────────────────────── */

.ncoe-apply-form select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 13px 10px !important;
  padding-right: 40px !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  cursor: pointer !important;
}

.ncoe-apply-form select option {
  background: #1a1033;
  color: #fff;
}

/* ── Slug — hidden but keep in DOM for JS ───────────────────────────────── */

.ncoe-apply-form input.startup-slug-field {
  display: none !important;
}

/* ── Description / helper text ──────────────────────────────────────────── */
/* Drupal 10 core renders as <div class="description"> */

.ncoe-apply-form .description,
.ncoe-apply-form .form-item__description,
.ncoe-apply-form small.form-text {
  font-size: 11px !important;
  color: rgba(255, 255, 255, 0.3) !important;
  margin-top: 6px !important;
  line-height: 1.5 !important;
  display: block !important;
}

/* ── Error states ────────────────────────────────────────────────────────── */

/* Red border + subtle glow on errored inputs */
.ncoe-apply-form .form-item--error input[type="text"],
.ncoe-apply-form .form-item--error input[type="email"],
.ncoe-apply-form .form-item--error input[type="url"],
.ncoe-apply-form .form-item--error input[type="tel"],
.ncoe-apply-form .form-item--error input[type="number"],
.ncoe-apply-form .form-item--error textarea,
.ncoe-apply-form .form-item--error select {
  border-color: #ff6b6b !important;
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.18) !important;
}

/* Inline error message — high-contrast pill so it's unmissable on purple */
.ncoe-apply-form .form-item--error-message {
  display: block !important;
  margin-top: 8px !important;
  padding: 6px 12px !important;
  background: rgba(255, 80, 80, 0.14) !important;
  border-left: 3px solid #ff6b6b !important;
  border-radius: 0 4px 4px 0 !important;
  font-family: 'Barlow', sans-serif !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #ffb3b3 !important;
  line-height: 1.5 !important;
}

/* "Error:" prefix Drupal prepends in a <strong> tag — match the container color */
.ncoe-apply-form .form-item--error-message strong {
  color: #ff8080 !important;
  font-weight: 700 !important;
}

/* Category wrapper error (container, not an input) */
.ncoe-apply-form .startup-cats-wrapper.form-item--error,
.ncoe-apply-form [data-drupal-selector="edit-cats-wrapper"].form-item--error {
  padding: 12px !important;
  border: 1px solid rgba(255, 107, 107, 0.45) !important;
  border-radius: 8px !important;
}

/* Drupal system messages block (status_messages) rendered inside the form area */
.ncoe-apply-form .messages,
.ncoe-apply-form .messages--error,
.ncoe-apply-form .messages--warning {
  border-radius: 8px !important;
  padding: 14px 18px !important;
  margin-bottom: 16px !important;
  font-family: 'Barlow', sans-serif !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.6 !important;
}

.ncoe-apply-form .messages--error,
.ncoe-apply-form .messages.messages--error {
  background: rgba(224, 80, 80, 0.18) !important;
  border: 1px solid rgba(224, 80, 80, 0.6) !important;
  color: #ff9a9a !important;
}

/* Make filename and extension (rendered as <em>) clearly visible */
.ncoe-apply-form .messages--error em,
.ncoe-apply-form .messages.messages--error em {
  font-style: normal !important;
  font-weight: 700 !important;
  color: #ffb3b3 !important;
  background: rgba(255, 255, 255, 0.08) !important;
  padding: 1px 6px !important;
  border-radius: 3px !important;
}

/* Reset Bootstrap skeleton-loader interference on Drupal em.placeholder.
   Bootstrap .placeholder sets background-color:currentColor + opacity:.5,
   making the text completely invisible. */
em.placeholder {
  background-color: transparent !important;
  opacity: 1 !important;
  cursor: auto !important;
  display: inline !important;
  vertical-align: baseline !important;
  min-height: unset !important;
}

/* Placeholders inside status messages — highest specificity to beat the
   .js-form-managed-file .messages override above */
.ncoe-apply-form .messages--status em.placeholder,
.ncoe-apply-form .messages.messages--status em.placeholder,
.ncoe-apply-form .js-form-managed-file .messages.messages--status em.placeholder {
  font-style: normal !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.25) !important;
  padding: 1px 6px !important;
  border-radius: 3px !important;
}

.ncoe-apply-form .messages--status,
.ncoe-apply-form .messages.messages--status {
  background: rgba(152, 195, 121, 0.15) !important;
  border: 1px solid rgba(152, 195, 121, 0.5) !important;
  color: #c5e8a8 !important;
}

/* File widget inline error — only target error/warning, not status */
.ncoe-apply-form .js-form-managed-file .messages:not(.messages--status),
.ncoe-apply-form .js-form-managed-file .file-upload-help {
  color: #ff9a9a !important;
  font-size: 13px !important;
}

/* Suppress stale green flash messages on the apply / success pages.
   Errors and warnings remain visible so reCAPTCHA failures are shown to the user.
   .ncoe-apply-page is set explicitly on the <section> in the page template. */
.ncoe-apply-page .messages--status {
  display: none !important;
}

/* ── Category checkboxes ─────────────────────────────────────────────────── */

.ncoe-apply-form .startup-cats-wrapper .form-type--checkbox,
.ncoe-apply-form .startup-cats-wrapper .form-type-checkbox,
.ncoe-apply-form .startup-cats-wrapper .js-form-type-checkbox {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  margin-bottom: 10px !important;
}

/* Keep labels inline inside the flex row — override the block-label rule */
.ncoe-apply-form .startup-cats-wrapper .form-type--checkbox label,
.ncoe-apply-form .startup-cats-wrapper .form-type-checkbox label,
.ncoe-apply-form .startup-cats-wrapper .js-form-type-checkbox label {
  display: inline !important;
  margin-bottom: 0 !important;
}

.ncoe-apply-form .startup-cats-wrapper input[type="checkbox"] {
  accent-color: #efb53e !important;
  width: 15px !important;
  height: 15px !important;
  flex-shrink: 0;
  padding: 0 !important;
  border-radius: 3px !important;
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  cursor: pointer;
  appearance: auto !important;
  -webkit-appearance: auto !important;
}

.ncoe-apply-form .startup-cats-wrapper label.form-label,
.ncoe-apply-form .startup-cats-wrapper label.option,
.ncoe-apply-form .startup-cats-wrapper label {
  font-size: 14px !important;
  font-weight: 400 !important;
  letter-spacing: 0.2px !important;
  text-transform: none !important;
  color: rgba(255, 255, 255, 0.72) !important;
  margin-bottom: 0 !important;
  cursor: pointer !important;
}

/* ── File upload ─────────────────────────────────────────────────────────── */

.ncoe-apply-form .js-form-managed-file input[type="submit"],
.ncoe-apply-form .js-form-managed-file button {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.55) !important;
  border-radius: 6px !important;
  color: rgba(255, 255, 255, 0.75) !important;
  padding: 8px 18px !important;
  font-family: 'Barlow', sans-serif !important;
  font-size: 12px !important;
  letter-spacing: 0.5px !important;
  transition: all .35s !important;
  cursor: pointer !important;
}

.ncoe-apply-form .js-form-managed-file input[type="submit"]:hover,
.ncoe-apply-form .js-form-managed-file button:hover {
  background: rgba(255, 255, 255, 0.9) !important;
  color: #1a1a1a !important;
}

/* ── Submit button ───────────────────────────────────────────────────────── */

.ncoe-apply-form input[type="submit"].form-submit:not(.js-form-managed-file input) {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.65) !important;
  border-radius: 5px !important;
  color: #fff !important;
  padding: 13px 44px !important;
  font-family: 'Barlow', sans-serif !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 2.5px !important;
  text-transform: uppercase !important;
  transition: all .35s !important;
  cursor: pointer !important;
  box-shadow: none !important;
  width: auto !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

/* Target more broadly since :not() with nested selector isn't universally supported */
.ncoe-apply-form .form-actions input[type="submit"].form-submit {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.65) !important;
  border-radius: 5px !important;
  color: #fff !important;
  padding: 13px 44px !important;
  font-family: 'Barlow', sans-serif !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 2.5px !important;
  text-transform: uppercase !important;
  transition: all .35s !important;
  cursor: pointer !important;
  box-shadow: none !important;
  width: auto !important;
}

.ncoe-apply-form .form-actions input[type="submit"].form-submit:hover {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: #fff !important;
  color: #1a1a1a !important;
}

/* Remove the div wrapper from flex flow so the button is the direct flex item */
.ncoe-apply-form .apply-actions .js-form-wrapper {
  display: contents;
}

/* ── Actions row ─────────────────────────────────────────────────────────── */

.ncoe-apply-form .apply-actions {
  display: flex;
  align-items: center;
  gap: 32px;
  padding-top: 8px;
}

/* ── Back link ───────────────────────────────────────────────────────────── */

.apply-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.42) !important;
  font-family: 'Barlow', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-decoration: none !important;
  text-transform: uppercase;
  transition: color .3s;
}

.apply-back-link:hover {
  color: rgba(255, 255, 255, 0.85) !important;
}
