:root {
  --primary: #b1040e;
  --primary-rgb: 177, 4, 14;
  --white: #fff;
  --dark: #212529;
  --text-muted: #555;
  --font-family-sans-serif: "Roboto", sans-serif;
  --panel-radius: 1.5cqmin; 
  
  /* FIXED SCALING: Matches the Navbar Height exactly */
  --nav-height: 6.6vw; 
}

html, body {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

html {
  font-size: 16px;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  font-family: var(--font-family-sans-serif);
  color: var(--dark);
}

/* ============================================================
   LIQUID SCALING CONTEXT (The "Taj Hotel" Logic)
   ============================================================ */
.application-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; 
  
  min-height: 100vh;
  width: 100%;
  height: auto;
  
  /* CRITICAL FIX: Space for Nav + Buffer. Never overlaps! */
  padding-top: calc(var(--nav-height) + 0vw) !important;
  padding-bottom: 4vw !important;

  position: relative;
  background-image: url("https://web-studio-apps-bucket.s3.ap-south-1.amazonaws.com/SEF/application_form_banner.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.application-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.22);
  z-index: 1;
}

.application-wrapper {
  position: relative;
  z-index: 2;
  width: 94vw;
  max-width: 1600px;
  
  min-height: 0; 
  height: auto;

  border-radius: var(--panel-radius);
  background: transparent;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 0;

  container-type: inline-size;
  container-name: formScale;
  margin: auto; 
}

.application-wrapper::-webkit-scrollbar {
  height: 0.6cqmin;
}

.application-wrapper::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 0.5cqmin;
}

/* ============================================================
   LEFT PANEL: Highlights
   ============================================================ */
.highlights-panel {
  padding: 4.5cqmin;
  color: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  border-top-left-radius: var(--panel-radius);
  border-bottom-left-radius: var(--panel-radius);
}

.highlights-title {
  font-weight: 800;
  font-size: 3.5cqmin;
  margin-bottom: 1.5cqmin;
  position: relative;
  text-shadow: 0 0.4cqmin 1.2cqmin rgba(0, 0, 0, 0.55);
}

.highlights-title::after {
  content: "";
  position: absolute;
  bottom: -0.6cqmin;
  left: 0;
  width: 8cqmin;
  height: 0.5cqmin;
  background: var(--primary);
  border-radius: 0.3cqmin;
}

.highlights-list {
  list-style: none;
  padding: 0;
  margin: 3cqmin 0 0 0;
}

.highlights-list li {
  display: flex;
  align-items: center;
  gap: 1.5cqmin;
  font-size: 2.8cqmin;
  font-weight: 600;
  margin-bottom: 1.2cqmin;
  text-shadow: 0 0.1cqmin 0 rgba(0, 0, 0, 0.25);
}

.highlights-list li i {
  font-size: 3cqmin;
  min-width: 4cqmin;
}

.recruitment-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.5cqmin 0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 1.2cqmin;
  overflow: hidden;
  font-size: 2.3cqmin;
  font-weight: 600;
}

.recruitment-table th,
.recruitment-table td {
  padding: 1.2cqmin;
  text-align: left;
  border-bottom: 0.05cqmin solid rgba(255, 255, 255, 0.1);
}

.recruitment-table th {
  text-transform: uppercase;
  letter-spacing: 0.05cqmin;
}

.recruitment-table tr:last-child td {
  border-bottom: none;
}

.recruitment-note {
  font-size: 2cqmin !important;
  font-weight: 600;
  font-style: italic;
  margin-top: 1.2cqmin;
  line-height: 1.4;
}

/* ============================================================
   RIGHT PANEL: Form Glassmorphism
   ============================================================ */
.form-panel {
  padding: 4.5cqmin; 
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  border-radius: 4vw; 
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 2vw 6vw rgba(0, 0, 0, 0.4);
  border: 0.1vw solid rgba(255, 255, 255, 0.12);
  position: relative;
}

.form-panel-inner {
  padding-right: 1cqmin;
}

.form-panel-inner::-webkit-scrollbar {
  width: 0.6cqmin;
}

.form-panel-inner::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 0.6cqmin;
}

.form-panel h2 {
  font-size: 3.2cqmin;
  letter-spacing: 0.02em;
  color: var(--white);
  text-align: center;
  margin: 0 0 1.5cqmin 0;
  font-weight: 800;
}

/* Progress Bar */
.progress-bar-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  margin: 1cqmin 0 2cqmin; 
  padding: 0 5cqmin;
}

.progress-bar-container::before {
  content: "";
  position: absolute;
  top: 2.2cqmin;
  left: 10cqmin;
  right: 10cqmin;
  height: 0.3cqmin;
  background: #ffffff6b;
  z-index: 1;
}

#progress-line {
  position: absolute;
  top: 2.2cqmin;
  left: 10cqmin;
  height: 0.3cqmin;
  background: var(--primary);
  z-index: 2;
  transition: width 0.4s ease;
  width: 0%;
  max-width: calc(100% - 20cqmin);
}

.step {
  width: 12cqmin;
  text-align: center;
  z-index: 3;
}

.step .circle {
  width: 4.5cqmin;
  height: 4.5cqmin;
  border-radius: 50%;
  background: var(--white);
  border: 0.2cqmin solid rgba(0, 0, 0, 0.13);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #999;
  margin: 0.5cqmin auto;
  font-size: 1.8cqmin;
  transition: all 0.3s;
}

.step.active .circle {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.step .label {
  font-size: 1.6cqmin;
  margin-top: 0.8cqmin;
  color: #fff;
  font-weight: 600;
  transition: all 0.2s;
}

.step.completed .circle {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
  font-weight: 700;
}

.step.completed .circle::before {
  content: "✓";
  font-size: 2.5cqmin;
  font-weight: 700;
}

.step.completed .circle {
  font-size: 0;
}

/* Inputs */
.form-label {
  font-weight: 600;
  font-size: 1.8cqmin;
  color: var(--white);
  margin-bottom: 0.6cqmin; 
  margin-top: 0.4cqmin;
  display: block;
}

.form-control,
.form-select {
  background: rgba(255, 255, 255, 0.92);
  border: 0.1cqmin solid rgba(0, 0, 0, 0.08);
  border-radius: 0.8cqmin;
  padding: 1.2cqmin 1.5cqmin; 
  font-size: 1.8cqmin;
  height: auto; 
  transition: box-shadow 0.12s, border-color 0.12s;
}

.form-control::placeholder {
  color: #666;
  font-size: 1.8cqmin;
}

.form-select {
  padding-right: 4cqmin;
  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='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1.5cqmin center;
  background-size: 2cqmin 1.5cqmin;
}

#pref1[disabled] {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-image: none !important;
  background-color: rgba(255, 255, 255, 0.92) !important;
  padding-right: 1.5cqmin !important;
  cursor: default !important;
}

#pref1[disabled]::-ms-expand {
  display: none;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.3cqmin rgba(var(--primary-rgb), 0.22);
  background: var(--white);
  outline: none;
}

/* Grid & Spacing */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: -1cqmin;
  margin-right: -1cqmin;
}
.col-12 {
  flex: 0 0 100%;
  max-width: 100%;
}
.col-md-6 {
  flex: 0 0 50%;
  max-width: 50%;
}

.row > * {
  padding-left: 1cqmin;
  padding-right: 1cqmin;
  margin-top: 1.2cqmin; 
  position: relative; 
}

.field-error {
  color: #ffb9b9;
  font-weight: 600;
  font-size: 1.6cqmin;
  top: calc(100% + -0.4cqmin);
  left: 1.5cqmin;
  margin: 0;
  white-space: nowrap;
  z-index: 5;
}

/* ============================================================
   FIXED STEP HEIGHT (Solves the Step 2 stretching issue)
   ============================================================ */
.form-steps-wrapper {
  position: relative;
  display: block;
  min-height: 26vw; /* This perfectly locks the form card height so it NEVER shrinks or grows */
  box-sizing: border-box;
  width: 100%;
}

.form-step {
  display: none; /* Completely hides the step from the page so buttons don't stack */
  position: relative;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
  transform: translateY(1cqmin);
}

.form-step.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  animation: fadeIn 0.38s ease;
}

/* Navigation Buttons */
.form-navigation {
  margin-top: 2cqmin;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2.2cqmin;
}

.location-next-col {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  margin-top: 2cqmin;
}

.btn-form {
  padding: 0.9cqw 1.9cqw !important;
  font-weight: 700;
  border-radius: 999px;
  min-width: 15cqmin;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1cqmin;
  border: none;
  cursor: pointer;
  font-size: 1.8cqmin;
  transition: all 0.2s;
}

.btn-prev {
  background: var(--primary);
  color: var(--white);
}
.btn-prev:hover {
  background: white;
  color: var(--primary);
  border: 0.1cqmin solid rgba(255, 255, 255, 0.18);
}
.btn-next {
  background: var(--primary);
  color: var(--white);
}
.btn-next:hover:not(:disabled) {
  background: white;
  color: var(--primary);
  transform: translateY(-0.2cqmin);
}

.btn-form:disabled,
.btn-form.btn-disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  border: 0.1cqmin solid #fff;
  color: #fff;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(1cqmin); }
  to { opacity: 1; transform: translateY(0); }
}

/* Success Checkmark */
.success-check-icon {
  width: 12cqmin;
  height: 12cqmin;
  border-radius: 50%;
  margin: 4cqmin auto 2cqmin;
  display: grid;
  place-items: center;
  background: white;
  color: var(--primary);
}
.success-check-icon i {
  font-size: 6cqmin;
}

/* ============================================================
   SPINNERS & TOASTS (Overlay UI elements)
   ============================================================ */
.btn-spinner {
  background-color: white !important;
  color: var(--primary) !important;
  border: 1px solid var(--primary) !important;
}

.btn-spinner span.btn-spinner {
  display: inline-block;
  width: clamp(14px, 1.5vw, 18px);
  height: clamp(14px, 1.5vw, 18px);
  border: 2px solid var(--primary);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2147483647;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
  font-size: 1rem !important;
  padding: 1rem !important;
}

#toast-container .app-toast {
  background: #fff;
  border-left: 4px solid #b1040e;
  border-radius: 0.5rem;
  padding: 1rem !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 300px;
  animation: slideIn 0.28s ease;
}

#toast-container .app-toast.success { border-left-color: #28a745; }
#toast-container .app-toast.error { border-left-color: #dc3545; }
#toast-container .app-toast.warning { border-left-color: #ffc107; }
#toast-container .app-toast.info { border-left-color: #b1040e; }

#toast-container .toast-icon {
  font-size: 1.25rem;
  min-width: 24px;
  text-align: center;
}
#toast-container .toast-message {
  flex: 1;
  color: #222;
  font-weight: 500;
}
#toast-container .toast-close {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0;
}

@keyframes slideIn {
  from { transform: translateX(200px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
#toast-container .app-toast.removing {
  animation: slideOut 0.3s ease forwards;
}
@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(400px); opacity: 0; }
}

.toast-icon-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
  font-weight: bold;
}
.error-icon { background: #e74c3c; }
.success-icon { background: #2ecc71; }
.warning-icon { background: #f1c40f; color: black; }
.info-icon { background: #3498db; }

#success-wrapper {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: clamp(2rem, 5vw, 5rem);
  z-index: 10;
  align-items: center;
  justify-content: center;
}

#success-wrapper .success-card {
  width: 100%;
  max-width: 820px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 1rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.btn-primary:hover {
  background-color: white !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

/* ============================================================
   MODALS (Preview & Consent)
   ============================================================ */
.preview-modal,
.consent-modal,
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2147480000;
  align-items: center;
  justify-content: center;
}

.preview-modal.show,
.consent-modal.show,
.modal-overlay.active {
  display: flex;
}

.preview-modal-backdrop,
.consent-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.preview-modal-dialog,
.consent-modal-dialog,
.modal-content {
  position: relative;
  z-index: 2;
  background: #ffffff;
  border-radius: clamp(0.8rem, 1.5vw, 1.2rem);
  max-width: 860px;
  width: calc(100% - 2.2rem);
  max-height: 82vh;
  padding: clamp(1rem, 2vw, 1.8rem);
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.preview-modal-title {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 800;
  margin-bottom: 0.25rem;
  color: #222;
}
.preview-modal-subtitle {
  font-size: clamp(0.85rem, 1vw, 1rem);
  color: #555;
  margin-bottom: 1.1rem;
}
.preview-modal-close {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  color: #666;
}

/* TWO-COLUMN LAYOUT */
.preview-two-col {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
}
.preview-column {
  flex: 1 1 50%;
  min-width: 260px;
  display: flex;
}
.preview-card {
  background: #f7f7f9;
  border: 1px solid #ececf2;
  border-radius: 0.9rem;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.preview-section-heading {
  font-size: clamp(0.85rem, 1vw, 0.97rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.preview-item {
  margin-bottom: 0.32rem;
  font-size: clamp(0.8rem, 1vw, 0.94rem);
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}
.preview-label {
  font-weight: 600;
  color: #333;
}
.preview-value {
  color: #555;
  max-width: 60%;
  text-align: right;
  word-break: break-word;
}

.preview-modal-footer {
  margin-top: 1.2rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}
.btn-outline-secondary {
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
  border: 1px solid #ccc;
  background: white;
  font-weight: 600;
  font-size: 0.9rem;
}
.btn-outline-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: white;
}

/* CONSENT FORM MODAL STYLES */
.consent-modal-dialog {
  max-width: 1200px;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.consent-modal-header {
  padding: 2rem 2rem 1rem;
  border-bottom: 2px solid var(--primary);
  background: linear-gradient(135deg, var(--primary) 0%, #d90429 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.consent-logo-container {
  flex-shrink: 0;
}
.consent-logo {
  height: clamp(40px, 5vw, 60px);
  width: auto;
  object-fit: contain;
}
.consent-title-container {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: 100%;
  pointer-events: none;
}
.consent-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  margin: 0.5rem 0 0.25rem;
  color: white;
}
.consent-subtitle {
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 700;
  margin: 0;
  color: rgba(255, 255, 255, 0.95);
}

.consent-modal-body {
  padding: clamp(1rem, 3vw, 2rem);
  flex: 1;
  overflow-y: auto;
}
.consent-intro {
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  line-height: 1.6;
  color: var(--dark);
  text-align: justify;
}
.consent-requirements {
  background: #f8f9fa;
  padding: 1.25rem;
  border-radius: 0.8rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--primary);
}
.consent-requirements h4 {
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
}
.consent-list {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}
.consent-list li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
}
.consent-location {
  margin-top: 1rem;
  font-size: clamp(0.9rem, 1.1vw, 1rem);
  line-height: 1.6;
}
.consent-map-link {
  color: var(--primary);
  text-decoration: none;
  margin-left: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: all 0.3s ease;
  vertical-align: middle;
}
.consent-map-link i {
  font-size: 1.1rem;
  color: var(--primary);
  transition: all 0.3s ease;
}
.consent-map-link:hover {
  background: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(177, 4, 14, 0.3);
}
.consent-map-link:hover i {
  color: white;
}
.consent-address-link {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: all 0.3s ease;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.consent-address-link i {
  font-size: 1.1rem;
  flex-shrink: 0;
}
.consent-address-link:hover {
  color: #d90429;
  text-decoration-color: #d90429;
  text-decoration-thickness: 3px;
}

.consent-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e9ecef;
}
.consent-section:last-of-type {
  border-bottom: none;
}
.consent-section-title {
  font-size: clamp(1.1rem, 1.4vw, 1.3rem);
  font-weight: 700;
  color: var(--primary);
}
.consent-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.75rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s;
}
.consent-checkbox-label:hover {
  background-color: #f8f9fa;
}
.consent-checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin-top: 0.2rem;
  cursor: pointer;
  accent-color: var(--primary);
}
.consent-checkbox-text {
  flex: 1;
  font-size: clamp(0.85rem, 1vw, 0.95rem);
  line-height: 1.6;
  color: var(--dark);
}

/* Consent Point Boxes */
.consent-points-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}
.consent-point-box {
  background: #ffffff;
  border: 2px solid #e9ecef;
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.consent-point-box:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(177, 4, 14, 0.1);
  transform: translateY(-2px);
}
.consent-point-box:has(input:checked) {
  border-color: var(--primary);
  background: linear-gradient(
    to right,
    rgba(177, 4, 14, 0.03),
    rgba(177, 4, 14, 0.01)
  );
  box-shadow: 0 4px 12px rgba(177, 4, 14, 0.15);
}
.consent-point-label {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  cursor: pointer;
  margin: 0;
  width: 100%;
}
.consent-point-label input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-width: 22px;
  margin-top: 0.15rem;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.consent-point-text {
  flex: 1;
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  color: var(--dark);
}
.consent-point-label:hover .consent-point-text {
  color: var(--primary);
}

.consent-signature-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid #e9ecef;
}
.consent-signature-row {
  display: flex;
  gap: 1.5rem;
  align-items: flex-end;
}
.consent-signature-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.consent-signature-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0;
}
.consent-signature-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  border: 2px solid #e9ecef;
  border-radius: 0.5rem;
  background: #ffffff;
  color: var(--dark);
  transition: all 0.3s ease;
}
.consent-signature-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(177, 4, 14, 0.15);
}
.consent-signature-input::placeholder {
  color: #999;
}

@media (max-width: 768px) {
  .consent-point-box {
    padding: 1rem;
  }
  .consent-point-text {
    font-size: 0.9rem;
    line-height: 1.6;
  }
  .consent-point-label {
    gap: 0.75rem;
  }
  .consent-point-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
  }
  .consent-signature-row {
    flex-direction: column;
    gap: 1rem;
  }
  .consent-signature-field {
    width: 100%;
  }
}

.consent-compensation-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}
.consent-compensation-list li {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  position: relative;
  line-height: 1.6;
}
.consent-compensation-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
  font-size: 1.2rem;
}
.consent-table-intro {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  color: var(--dark);
}
.consent-table-wrapper {
  overflow-x: auto;
  margin: 1rem 0;
}
.consent-table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  overflow: hidden;
}
.consent-table thead {
  background: var(--primary);
  color: white;
}
.consent-table th {
  padding: 0.75rem 0.5rem;
  text-align: left;
  font-weight: 700;
  font-size: clamp(0.75rem, 0.9vw, 0.85rem);
}
.consent-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid #e9ecef;
  vertical-align: top;
}
.consent-table tbody tr:last-child td {
  border-bottom: none;
}
.consent-table tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}
.consent-remarks {
  font-size: 0.85rem;
  font-style: italic;
  color: #6c757d;
}

.consent-modal-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid #e9ecef;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  background: #f8f9fa;
  border-radius: 0 0 1.2rem 1.2rem;
}
.btn-consent-cancel,
.btn-consent-submit {
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}
.btn-consent-cancel {
  background: #6c757d;
  color: white;
}
.btn-consent-cancel:hover {
  background: #5a6268;
}
.btn-consent-submit {
  background: var(--primary);
  color: white;
  position: relative;
}
.btn-consent-submit:hover:not(:disabled) {
  background: #d90429;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(177, 4, 14, 0.3);
}

@media (max-width: 768px) {
  .consent-modal-dialog {
    max-width: 100%;
    max-height: 95vh;
    border-radius: 0.8rem;
  }
  .consent-modal-header {
    padding: 1.5rem 1rem 1rem;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  .consent-title-container {
    position: static;
    transform: none;
    width: auto;
  }
  .consent-logo-container {
    order: 1;
  }
  .consent-title-container {
    order: 2;
  }
  .consent-title {
    font-size: 1.5rem;
  }
  .consent-subtitle {
    font-size: 1.2rem;
  }
  .consent-modal-body {
    padding: 1.5rem 1rem;
  }
  .consent-table {
    font-size: 0.8rem;
  }
  .consent-table th,
  .consent-table td {
    padding: 0.5rem 0.35rem;
  }
  .consent-modal-footer {
    padding: 1rem;
    flex-direction: column;
  }
  .btn-consent-cancel,
  .btn-consent-submit {
    width: 100%;
  }
  tbody,
  td,
  tfoot,
  th,
  thead,
  tr {
    padding: 9px !important;
  }
}

/* Institution Modal Styles */
.modal-header {
  background-color: var(--primary);
  color: white;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 12px 12px 0 0;
}
.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}
.modal-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}
.modal-body {
  padding: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}
.list-group {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #e9ecef;
  border-radius: 8px;
}
.list-group-item {
  border: none;
  border-bottom: 1px solid #e9ecef;
  padding: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-align: left;
}
.list-group-item:last-child {
  border-bottom: none;
}
.list-group-item:hover {
  background-color: #f8f9fa;
}
.list-group-item h6 {
  margin: 0;
  font-weight: 600;
  color: #333;
}
.list-group-item .text-muted {
  font-size: 0.875rem;
}

/* FIX: Institution modal items */

.institution-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

.institution-name {
  flex: 1;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.institution-code {
  flex-shrink: 0;
  font-weight: 600;
  color: #b1040e;
  margin-left: 12px;
}

/* Hover */

.institution-item:hover {
  background: #f7f7f7;
}
.file-hint {
  font-size: clamp(0.6rem, 2cqmin, 0.95rem);
}

/* ============================================================
   COMPLETE MOBILE RESPONSIVE FIX (Combined Logic)
   Targets screens 768px and below
   ============================================================ */
@media (max-width: 768px) {
  .application-section {
    height: auto !important;
    min-height: 100svh;
    padding: 80px 0.5rem 2rem 0.5rem !important;
    overflow-y: visible !important;
    display: block !important; /* Removes flex centering to allow natural scroll */
  }

  .application-wrapper {
    display: flex !important;
    flex-direction: column !important; /* Stacks highlights above form */
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    gap: 0 !important;
    border-radius: 0.8rem !important;
    margin-bottom: 3rem;
    /* CRITICAL: Disables the Desktop cqmin/cqh scaling logic */
    container-type: normal !important;
  }

  /* --- Panels --- */
  .highlights-panel,
  .form-panel {
    width: 100% !important;
    min-width: 0 !important;
    padding: 1.5rem 1.2rem !important;
    height: auto !important;
  }

  .highlights-panel {
    border-radius: 0.8rem 0.8rem 0 0 !important;
  }

  .form-panel {
    border-radius: 0.8rem  !important;
    backdrop-filter: blur(12px) !important;
  }

  /* --- Typography (Standard units for readability) --- */
  .highlights-title {
    font-size: 1.6rem !important;
    margin-bottom: 1.2rem !important;
  }
  .highlights-title::after {
    width: 50px !important;
    height: 4px !important;
    bottom: -8px !important;
  }

  .highlights-list li {
    font-size: 1.1rem !important;
    margin-bottom: 0.8rem !important;
    gap: 12px !important;
  }
  .highlights-list li i {
    font-size: 1.4rem !important;
    min-width: 25px !important;
  }

  .recruitment-table {
    font-size: 0.95rem !important;
    margin: 1.2rem 0 !important;
  }
  .recruitment-table th,
  .recruitment-table td {
    padding: 10px !important;
  }

  .form-panel h2 {
    font-size: 1.6rem !important;
    margin-bottom: 1.5rem !important;
  }

  /* --- Progress Bar --- */
  .progress-bar-container {
    margin: 0.5rem 0 2rem !important;
    padding: 0 10px !important;
    display: flex;
  }
  .progress-bar-container::before,
  #progress-line {
    top: 19px !important;
    height: 2px !important;
    right: 50px !important;
  }
  .step {
    width: 90px !important;
  }
  .step .circle {
    width: 38px !important;
    height: 38px !important;
    font-size: 15px !important;
    border-width: 2px !important;
    margin: 0 auto !important;
  }
  
  /* FIX FOR ISSUE 2: Progress Bar Checkmark Overlap */
  .step.completed .circle {
    font-size: 0 !important; /* Hides the number */
  }
  .step.completed .circle::before {
    font-size: 18px !important; /* Sizes the checkmark correctly */
  }
  
  .step .label {
    font-size: 0.85rem !important;
    margin-top: 8px !important;
  }

  /* --- Form Fields & Inputs --- */
  .form-steps-wrapper {
    min-height: auto !important;
    padding: 0 !important;
  }
  
  .form-label, .form-control, .form-select {
    font-size: 0.98rem !important;
  }

  .row.g-3,
  .row.g-2 {
    flex-direction: column !important;
  }

  .col-md-6,
  .col-12 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    position: relative !important;
  }

  /* Ensure hidden elements stay hidden on mobile */
  #university-other-wrapper[style*="display: none"],
  #portfolio-wrapper[style*="display: none"] {
    display: none !important;
  }

  .form-label {
    font-size: 0.95rem !important;
    margin-bottom: 6px !important;
    margin-top: 6px !important;
  }

  .form-control,
  .form-select {
    height: 48px !important; /* Fixed height for touch devices */
    font-size: 1rem !important;
    padding: 10px 15px !important;
    border-radius: 8px !important;
    width: 100% !important;
  }
  
  .form-control::placeholder {
    font-size: 0.95rem !important;
    color: #999 !important;
  }
  
  .form-select {
    padding-right: 35px !important;
    background-position: right 12px center !important;
    background-size: 16px 12px !important;
  }

  /* --- Error Text Fix --- */
  .field-error {
    font-size: 0.82rem !important;
    position: relative !important; /* Prevents text from floating over next input */
    top: 4px !important;
    left: 0 !important;
    display: block !important;
    white-space: normal !important;
    color: #ffb9b9 !important;
    padding-bottom: 5px !important;
  }

  /* --- Navigation Buttons (Forced Single Line Fix) --- */
  .form-navigation {
      margin-top: 1.5rem !important;
      padding: 0 !important;
      display: flex !important;
      flex-wrap: nowrap !important; /* Forbids dropping to a second line */
      justify-content: center !important;
      gap: 5px !important; /* Very tight gap to ensure 3 buttons fit */
      width: 100% !important;
  }

  .btn-form {
      /* CRITICAL: "auto" allows the Submit button to stretch safely to fit "Submitting..." */
      flex: 1 1 auto !important; 
      min-width: 0 !important; 
      height: 40px !important; 
      font-size: 0.75rem !important; /* Shrunk font slightly so all 3 fit on tiny phones */
      padding: 0 10px !important; /* Tight padding */
      border-radius: 30px !important;
      
      /* NO !important here so JS can still hide Step 1 buttons */
      display: inline-flex; 
      align-items: center !important;
      justify-content: center !important;
      white-space: nowrap !important; /* Prevents text inside the button from wrapping */
  }

  /* --- Shrink the spinning circle specifically for mobile so it fits perfectly --- */
  .btn-spinner span.btn-spinner {
      width: 12px !important;
      height: 12px !important;
      margin-right: 5px !important;
      border-width: 2px !important;
  }

  /* --- Success Message --- */
  .success-check-icon {
    width: 65px !important;
    height: 65px !important;
    margin: 0 auto 1.2rem !important;
  }
  .success-check-icon i {
    font-size: 32px !important;
  }

  .location-next-col {
    display: none !important;
  }
  
  .file-hint {
    font-size: 0.9rem !important;
  }

  /* --- FIX: Search Bar Input Group Layout --- */
  .input-group {
      display: flex !important;
      flex-wrap: nowrap !important; /* Forces icon to stay on the same line */
  }

  .input-group .form-control {
      width: 1% !important; /* Bootstrap standard to make it share space */
      flex: 1 1 auto !important;
      border-top-right-radius: 0 !important;
      border-bottom-right-radius: 0 !important;
  }

  .input-group-text {
      display: flex !important;
      align-items: center !important;
      padding: 0 15px !important;
      background: #f8f9fa !important;
      border: 1px solid rgba(0, 0, 0, 0.08) !important;
      border-left: none !important;
      border-top-right-radius: 8px !important;
      border-bottom-right-radius: 8px !important;
  }
  .recruitment-note {
    font-size: 1rem !important;
    font-style: italic;
    margin-top: 1.2cqmin;
    line-height: 1.4;
  }
}