:root {
  color-scheme: light;
}

body {
  background: #eff2f7;
}

.portal-shell {
  border: 1px solid #d6ddea;
  border-radius: 1rem;
  background: #ffffff;
  overflow: hidden;
}

.portal-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  padding: 0.95rem 1.2rem;
  border-bottom: 1px solid #dde4ef;
  background: #f5f7fb;
}

.hero-panel {
  margin: 1.2rem;
  border: 1px solid #d7deeb;
  border-radius: 1rem;
  background: #ffffff;
  padding: 1.6rem;
}

.hero-copy {
  max-width: 720px;
}

.form-shell {
  border: 1px solid #d7deeb;
  border-radius: 1rem;
  background: #ffffff;
  padding: 0.9rem;
  overflow: hidden;
}

#application-form {
  display: grid;
  gap: 1.8rem;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 0.35rem 0.6rem;
}

.card-section {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.card-section + .card-section {
  border-top: 1px solid #e4eaf3;
  padding-top: 1.7rem;
}

.section-title {
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.48rem;
  font-size: 1.95rem;
  line-height: 1.1;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.section-title + * {
  margin-top: 0 !important;
}

.section-title .material-symbols-outlined {
  font-size: 1.1rem;
  color: #1e3b8a;
  background: #eef3fb;
  border-radius: 0.5rem;
  padding: 0.2rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.87rem;
  font-weight: 700;
  color: #243247;
}

.required {
  display: inline-flex;
  align-items: center;
  margin-left: 0.1rem;
  border-radius: 9999px;
  border: 1px solid #fca5a5;
  background: #fef2f2;
  color: #dc2626;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.18rem 0.42rem;
  line-height: 1;
}

.card-section input:not([type="checkbox"]):not([type="radio"]),
.card-section select,
.card-section textarea {
  width: 100%;
  border: 1px solid #c8d5e8 !important;
  border-radius: 0.78rem !important;
  background: #fbfcfe !important;
  color: #0f172a;
  font-size: 1rem;
  line-height: 1.4;
  min-height: 50px;
  padding: 0.78rem 0.86rem !important;
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.card-section textarea {
  min-height: 112px;
  resize: vertical;
}

.card-section input::placeholder,
.card-section textarea::placeholder {
  color: #8fa1ba;
}

.card-section input:not([type="checkbox"]):not([type="radio"]):focus,
.card-section select:focus,
.card-section textarea:focus {
  border-color: #2f52a5 !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(47, 82, 165, 0.14) !important;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: #1e3b8a;
  width: 1rem;
  height: 1rem;
  margin-top: 0.16rem;
}

.inline-check {
  display: flex;
  align-items: flex-start;
  min-width: 0;
  gap: 0.62rem;
  border: 1px solid #d3ddeb;
  border-radius: 0.78rem;
  background: #ffffff;
  padding: 0.72rem 0.78rem;
  font-size: 0.94rem;
  color: #1e293b;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.inline-check:hover {
  border-color: #b9c8de;
  background: #fbfcff;
}

.inline-check:has(input:checked) {
  border-color: #1e3b8a;
  background: #f6f9ff;
  box-shadow: 0 0 0 3px rgba(30, 59, 138, 0.1);
}

.plan-highlight {
  border: 1px solid #9fb6df;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, #eef4ff 0%, #f8fbff 100%);
  padding: 0.9rem;
  box-shadow: 0 8px 20px rgba(30, 59, 138, 0.08);
}

.plan-highlight-title {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.94rem;
  font-weight: 800;
  color: #1e3b8a;
  letter-spacing: 0.01em;
}

.plan-highlight-title .material-symbols-outlined {
  font-size: 1.05rem;
}

.plan-highlight .inline-check {
  border-color: #a8bddf;
}

.plan-highlight-note {
  margin-top: 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1d4ed8;
}

.terms-scroll {
  max-height: 16rem;
  overflow-y: auto;
  overflow-x: hidden;
  word-break: break-word;
}

.terms-scroll a {
  overflow-wrap: anywhere;
}

.form-action-row {
  border-top: 1px solid #dfe6f2;
  padding-top: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
}

.form-action-note {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.87rem;
  color: #64748b;
}

.form-action-note .material-symbols-outlined {
  font-size: 1rem;
}

/* Force a unified visual system even when Tailwind utility classes are mixed in markup */
#form-view .rounded-xl,
#form-view .rounded-2xl,
#form-view .rounded-lg {
  border-radius: 0.78rem !important;
}

#form-view .border-slate-200,
#form-view .border-slate-300 {
  border-color: #d3ddeb !important;
}

#form-view .bg-background-offset,
#form-view .bg-white,
#form-view .bg-blue-50,
#form-view .bg-slate-50 {
  background-color: #ffffff !important;
}

#form-view .p-3,
#form-view .p-4,
#form-view .p-5 {
  padding: 0.85rem !important;
}

#form-view .text-sm {
  font-size: 0.93rem !important;
}

.submit-primary-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 0.78rem;
  background: #1e3b8a;
  color: #ffffff;
  padding: 0.9rem 1rem;
  font-size: 0.98rem;
  font-weight: 700;
  transition: background-color 170ms ease, transform 170ms ease, box-shadow 170ms ease, opacity 170ms ease;
  box-shadow: 0 8px 18px rgba(30, 59, 138, 0.25);
}

.submit-primary-btn:hover {
  background: #173173;
  transform: translateY(-1px);
}

.submit-primary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #c7d2e3;
  border-radius: 0.7rem;
  background: #ffffff;
  padding: 0.55rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
}

.copy-btn:hover {
  background: #f8fafc;
}

.completion-shell {
  border: 1px solid #d7deeb;
  border-radius: 1rem;
  background: #ffffff;
  padding: 1.3rem;
}

input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
}

@media (min-width: 860px) {
  .hero-copy {
    max-width: 800px;
  }

  .form-shell {
    padding: 1rem;
  }

  .form-action-row {
    flex-direction: row;
  }

  .submit-primary-btn {
    width: 280px;
  }

  .completion-shell {
    padding: 2rem;
  }
}

@media (max-width: 859px) {
  body {
    overflow-x: hidden;
  }

  .portal-shell {
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
  }

  .portal-topbar {
    border-bottom: 0;
    background: transparent;
    padding: 0 0.2rem 0.65rem;
  }

  .hero-panel {
    margin: 0 0 1rem;
    border: 0;
    border-radius: 0;
    padding: 0 0.2rem;
    background: transparent;
  }

  .form-shell {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
  }

  #application-form {
    padding: 0 0 0.45rem;
    gap: 1.55rem;
  }

  .completion-shell {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
  }

  .section-title {
    font-size: 1.45rem;
  }
}
