/* ── Fonts ─────────────────────────────────────────────────────────────────── */
@font-face { font-family: "Poppins-Light";    src: url("fonts/Poppins-Light.ttf"); }
@font-face { font-family: "Poppins-Regular";  src: url("fonts/Poppins-Regular.ttf"); }
@font-face { font-family: "Poppins-Medium";   src: url("fonts/Poppins-Medium.ttf"); }
@font-face { font-family: "Poppins-SemiBold"; src: url("fonts/Poppins-SemiBold.ttf"); }
@font-face { font-family: "Poppins-Bold";     src: url("fonts/Poppins-Bold.ttf"); }
@font-face { font-family: "DMSans-Regular";   src: url("fonts/DMSans-Regular.ttf"); }
@font-face { font-family: "DMSans-Medium";    src: url("fonts/DMSans-Medium.ttf"); }

/* ── Reset / Base ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "DMSans-Regular", system-ui, sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: "Poppins-SemiBold"; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }
ul, ol { list-style: none; padding: 0; margin: 0; }
img { display: block; max-width: 100%; }
input, select, textarea { font-family: "DMSans-Regular"; }

/* ── Top ribbon ──────────────────────────────────────────────────────────────── */
.ribbon {
  height: 4px;
  background: var(--primary);
  width: 100%;
}

/* ── Site header ─────────────────────────────────────────────────────────────── */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid #ebebeb;
  padding: 0 28px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
}

.brand-initials {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: #f5f5f4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "DMSans-Medium";
  font-size: 15px;
  color: #374151;
  flex-shrink: 0;
}

.brand-text { min-width: 0; }

.brand-name {
  font-family: "Poppins-SemiBold";
  font-size: 19px;
  line-height: 1.25;
  color: #111111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-tagline {
  font-family: "DMSans-Regular";
  font-size: 12px;
  color: #6b7280;
  margin-top: 1px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trust-line {
  font-family: "DMSans-Regular";
  font-size: 11px;
  color: #9ca3af;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-trigger {
  background: none;
  border: none;
  cursor: pointer;
  font-family: "DMSans-Medium";
  font-size: 13px;
  color: var(--primary-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  white-space: nowrap;
  padding: 6px 0;
  transition: color 0.2s;
}
.status-trigger:hover { color: var(--primary); }

/* ── Page grid ───────────────────────────────────────────────────────────────── */
main { overflow: hidden; }

.page-grid {
  display: grid;
  grid-template-columns: 30fr 70fr;
  min-height: calc(100vh - 76px);
}

/* ── Left rail ───────────────────────────────────────────────────────────────── */
.left-rail {
  background: var(--primary-tint);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 32px 24px;
}

/* Decorative circle — large low-opacity theme arc, bottom-right */
.left-rail::after {
  content: '';
  position: absolute;
  bottom: -90px;
  right: -90px;
  width: 310px;
  height: 310px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
}

.rail-top {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rail-bottom {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.open-badge {
  font-family: "Poppins-SemiBold";
  font-size: 36px;
  line-height: 1.2;
  color: #111111;
}

.open-accent { color: var(--primary); }

.open-sub {
  font-size: 13px;
  color: #6b7280;
  margin-top: -10px;
}

.rail-block { display: flex; flex-direction: column; gap: 8px; }

.rail-label {
  font-family: "DMSans-Medium";
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #9ca3af;
  text-transform: uppercase;
}

.rail-value {
  font-size: 13px;
  color: #374151;
  line-height: 1.5;
}

.rail-value--sub {
  color: #6b7280;
  font-size: 12px;
  margin-top: -4px;
}

/* XI/XII chips */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  display: inline-block;
  border: 1.5px solid var(--primary-dark);
  color: var(--primary-dark);
  border-radius: 20px;
  padding: 4px 13px;
  font-size: 13px;
  font-family: "DMSans-Medium";
  line-height: 1.5;
}

/* About text — clamped to 4 lines with JS-driven expand */
.about-text {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.about-text.expanded {
  display: block;
  overflow: visible;
}

.about-toggle {
  display: none; /* JS reveals when text is actually clamped */
  background: none;
  border: none;
  cursor: pointer;
  font-family: "DMSans-Medium";
  font-size: 12px;
  color: var(--primary-dark);
  padding: 4px 0 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.about-toggle:hover { color: var(--primary); }

/* Contact block */
.contact-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.09);
}

.contact-name {
  font-family: "DMSans-Medium";
  font-size: 12px;
  color: #374151;
  margin-bottom: -4px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #374151;
  transition: color 0.15s;
}
.contact-item:hover { color: var(--primary); }

/* Address row — top-aligned icon, muted smaller text */
.contact-item--address {
  align-items: flex-start;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
  cursor: default;
}
.contact-item--address .contact-icon { margin-top: 2px; }

.contact-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Social icons */
.social-row {
  display: flex;
  gap: 14px;
  align-items: center;
}

.social-link {
  display: flex;
  align-items: center;
  opacity: 0.55;
  transition: opacity 0.2s;
}
.social-link:hover { opacity: 1; }

.social-icon { width: 18px; height: 18px; }

/* ── Form area ───────────────────────────────────────────────────────────────── */
.form-area {
  background: #ffffff;
  padding: 28px 36px 32px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* ── Form sections ───────────────────────────────────────────────────────────── */
.form-section {
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid #f0f1f3;
}
.form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.section-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-contrast);
  font-size: 11px;
  font-family: "DMSans-Medium";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-label {
  font-family: "Poppins-SemiBold";
  font-size: 15px;
  color: #111111;
  letter-spacing: 0.01em;
}

/* ── Form grids ──────────────────────────────────────────────────────────────── */
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 14px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 14px;
}

/* ── Form fields ─────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; }

.form-group label {
  font-size: 12px;
  color: #374151;
  margin-bottom: 5px;
  font-family: "DMSans-Regular";
  line-height: 1.4;
}

.req { color: #ef4444; }

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 15px;
  font-family: "DMSans-Regular";
  color: #1a1a1a;
  background: #ffffff;
  height: 44px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.form-group textarea {
  height: auto;
  resize: none;
  overflow-y: auto;
  scrollbar-width: none;
}
.form-group textarea::-webkit-scrollbar { display: none; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

/* Select dropdown arrow */
.form-group select {
  background-image: url("images/down-arrow.png");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 32px;
  cursor: pointer;
}

/* DOB calendar icon */
.dob-input {
  background-image: url("images/calender.svg");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 32px;
  cursor: pointer;
}

/* Full-width row for address */
.form-group--full { margin-top: 12px; }
.form-group--full textarea { height: 76px; }

/* Inline field error messages */
.error {
  color: #ef4444;
  font-size: 11px;
  line-height: 1.4;
  min-height: 0;
  margin-top: 3px;
  display: block;
}

/* ── Form alert panel (server errors / validation summary) ───────────────────── */
#formAlert { margin-top: 14px; }

.form-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: 8px;
  padding: 12px 14px;
}

.form-alert--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.alert-icon { flex-shrink: 0; margin-top: 1px; }
.alert-body { flex: 1; min-width: 0; }

.alert-msg {
  font-size: 13px;
  line-height: 1.5;
}

.alert-list {
  list-style: disc;
  padding-left: 16px;
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── Submit row ──────────────────────────────────────────────────────────────── */
.submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #f3f4f6;
}

.privacy-note {
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.4;
}

/* ── Primary button ──────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--primary);
  color: var(--primary-contrast);
  border: none;
  border-radius: 8px;
  padding: 10px 26px;
  font-size: 14px;
  font-family: "DMSans-Medium";
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Success panel ───────────────────────────────────────────────────────────── */
.success-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
  gap: 14px;
}

.success-icon-wrap svg { display: block; }

.success-title {
  font-family: "Poppins-SemiBold";
  font-size: 24px;
  color: #111111;
}

.success-sub {
  font-size: 14px;
  color: #4b5563;
}

.success-next {
  margin-top: 8px;
  background: #f9fafb;
  border-radius: 10px;
  padding: 18px 22px;
  text-align: left;
  max-width: 440px;
  width: 100%;
}

.success-next-label {
  font-family: "DMSans-Medium";
  font-size: 11px;
  letter-spacing: 0.07em;
  color: #9ca3af;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.success-next-list {
  list-style: decimal;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.success-next-list li {
  font-size: 13px;
  color: #374151;
  line-height: 1.5;
}

.link-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary-dark);
  font-size: inherit;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
}
.link-btn:hover { color: var(--primary); }

/* ── Status modal ────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-box {
  background: #ffffff;
  border-radius: 14px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 22px 0;
}

.modal-title {
  font-family: "Poppins-SemiBold";
  font-size: 17px;
  color: #111111;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: #f3f4f6; color: #111111; }

.modal-body { padding: 18px 22px 22px; }

.modal-input-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

/* ── Status result states ────────────────────────────────────────────────────── */
.status-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6b7280;
  padding: 16px 0 4px;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #e5e7eb;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status-card {
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafaf9;
}

.status-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.status-name {
  font-family: "DMSans-Medium";
  font-size: 14px;
  color: #111111;
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-family: "DMSans-Medium";
  flex-shrink: 0;
}
.badge--submitted { background: #f3f4f6; color: #374151; }
.badge--review    { background: #fef9c3; color: #854d0e; }
.badge--approved  { border: 1.5px solid var(--primary-dark); color: var(--primary-dark); background: transparent; }
.badge--rejected  { background: #fee2e2; color: #991b1b; }

.status-detail { font-size: 12px; color: #6b7280; margin-top: 4px; }
.status-detail strong { color: #374151; }

.status-not-found {
  margin-top: 14px;
  font-size: 13px;
  color: #6b7280;
  padding: 12px 14px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.status-error { margin-top: 12px; font-size: 13px; color: #ef4444; }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .page-grid { grid-template-columns: 34fr 66fr; }
  .form-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .form-area { padding: 24px 28px 28px; }
  .left-rail { padding: 28px 20px; }
  .open-badge { font-size: 30px; }
}

@media (max-width: 768px) {
  .page-grid { grid-template-columns: 1fr; min-height: unset; }
  .left-rail {
    border-bottom: 1px solid #ebebeb;
    padding: 20px 20px 18px;
  }
  .about-text { display: block; overflow: visible; }
  .about-toggle { display: none; }
  .rail-top { gap: 14px; }
  .open-badge { font-size: 22px; }
  .form-area { padding: 20px 16px 24px; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .submit-row { flex-direction: column; align-items: stretch; }
  .submit-row .btn-primary { width: 100%; }
  .site-header { padding: 0 16px; }
  .brand-name { font-size: 16px; }
  .brand-tagline { display: none; }
}

@media (max-width: 480px) {
  .brand-name { font-size: 14px; max-width: 160px; }
  .trust-line { max-width: 160px; }
  .header-inner { gap: 10px; }
  .status-trigger { font-size: 12px; }
}
