/* Application Form Page Styling - Matching Reference Layout and YS Global Study Royal Blue/White Style */

.application-document {
  background-color: #f8fafc;
  color: #1e293b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  padding: 0;
}

.application-page {
  min-height: 100vh;
  padding: 30px 16px 60px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-right: auto;
  margin-left: auto;
  padding-right: 15px;
  padding-left: 15px;
  box-sizing: border-box;
}

.d-flex {
  display: flex !important;
}

.justify-content-center {
  justify-content: center !important;
}

.align-items-center {
  align-items: center !important;
}

.text-center {
  text-align: center !important;
}

.text-danger {
  color: #dc2626 !important;
  font-weight: 700;
}

.text-white {
  color: #ffffff !important;
}

.text-muted {
  color: #64748b !important;
}

.my-4 {
  margin-top: 1.5rem !important;
  margin-bottom: 1.5rem !important;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mb-2 {
  margin-bottom: 0.5rem !important;
}

.mb-3 {
  margin-bottom: 1rem !important;
}

.mb-4 {
  margin-bottom: 1.5rem !important;
}

.mt-2 {
  margin-top: 0.5rem !important;
}

.mt-4 {
  margin-top: 1.5rem !important;
}

.mt-5 {
  margin-top: 3rem !important;
}

.ms-3 {
  margin-left: 1rem !important;
}

.p-3 {
  padding: 1rem !important;
}

.p-4 {
  padding: 1.5rem !important;
}

.pb-0 {
  padding-bottom: 0 !important;
}

.w-25 {
  width: 25% !important;
}

.w-75 {
  width: 75% !important;
}

.align-middle {
  vertical-align: middle !important;
}

/* Grid System */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -10px;
  margin-left: -10px;
}

.row > * {
  box-sizing: border-box;
  padding-right: 10px;
  padding-left: 10px;
}

.col-12 {
  flex: 0 0 100%;
  max-width: 100%;
}

.col-4 {
  flex: 0 0 33.333333%;
  max-width: 33.333333%;
}

.col-8 {
  flex: 0 0 66.666667%;
  max-width: 66.666667%;
}

@media (min-width: 576px) {
  .col-sm-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (min-width: 768px) {
  .col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
  .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
  .col-md-9 {
    flex: 0 0 75%;
    max-width: 75%;
  }
}

@media (min-width: 992px) {
  .col-lg-8 {
    flex: 0 0 66.666667%;
    max-width: 780px;
  }
}

/* Main Card */
.application-card-container {
  background-color: #ffffff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(28, 104, 203, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
}

/* Header Banner - Royal Blue */
.application-header-bar {
  background-color: #1c68cb !important;
  padding: 18px 20px;
  text-align: center;
  color: #ffffff;
}

.application-header-bar h1 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 4px;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.application-header-bar p {
  font-size: 15px;
  margin: 0;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 400;
}

.application-body-inner {
  padding: 32px 36px 40px;
}

.application-intro-text {
  font-size: 15px;
  line-height: 1.6;
  color: #334155;
  margin: 0 auto 20px;
  max-width: 680px;
  text-align: center;
}

/* Field Typography */
.c-fs {
  font-size: 16px;
  font-weight: 500;
  color: #0f172a;
  line-height: 1.5;
  margin-bottom: 6px;
  display: block;
}

.c-fc {
  color: #64748b;
  font-size: 13.5px;
  line-height: 1.45;
}

.c-fs-sm {
  font-size: 14px;
  color: #334155;
}

.form-label {
  margin-bottom: 6px;
}

/* Form Controls */
.form-control,
.form-select {
  display: block;
  width: 100%;
  height: 38px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: #1e293b;
  background-color: #ffffff;
  background-clip: padding-box;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  box-sizing: border-box;
  font-family: inherit;
}

.form-control::placeholder {
  color: #94a3b8;
  opacity: 1;
}

.form-control:hover,
.form-select:hover {
  border-color: #94a3b8;
}

.form-control:focus,
.form-select:focus {
  color: #0f172a;
  background-color: #ffffff;
  border-color: #1c68cb;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(28, 104, 203, 0.14);
}

select.form-control,
select.form-select {
  cursor: pointer;
}

/* Section 1: Passport Size Photo */
.upload-instructions {
  font-size: 13.5px;
  color: #64748b;
  margin-bottom: 8px;
}

.upload-box {
  width: 165px;
  height: 150px;
  border: 2px dashed #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 6px;
  background-color: #f8fafc;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
  box-sizing: border-box;
}

.upload-box:hover {
  border-color: #1c68cb;
  background-color: #eff6ff;
}

.upload-box input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 5;
}

.upload-box__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  pointer-events: none;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.upload-box__icon {
  margin-bottom: 8px;
  flex-shrink: 0;
}

#imgtext {
  font-size: 13px;
  color: #64748b;
  line-height: 1.35;
}

.help-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
}

.help-logo {
  max-width: 180px;
  max-height: 140px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin-bottom: 10px;
  border-radius: 4px;
}

.help-link {
  color: #1c68cb !important;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  transition: color 0.15s ease;
}

.help-link:hover {
  color: #1657ab !important;
  text-decoration: underline;
}

/* Dividers & Headings */
hr {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 28px 0;
  opacity: 1;
}

h5.text-center {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Education Tables */
.education-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 8px;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
}

.education-table th,
.education-table td {
  border: 1px solid #cbd5e1;
  padding: 8px 12px;
  vertical-align: middle;
}

.education-table thead th {
  background-color: #f8fafc;
  color: #0f172a;
  font-weight: 600;
  font-size: 15px;
}

.education-table tbody td.c-fs-sm {
  font-size: 14px;
  color: #334155;
  width: 25%;
  min-width: 140px;
}

.education-table .form-control {
  margin: 0;
  height: 36px;
}

/* Checkboxes (Field 32) */
.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  cursor: pointer;
}

.form-check-input {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: #1c68cb;
  flex-shrink: 0;
}

.form-check-label {
  font-size: 15px;
  color: #1e293b;
  cursor: pointer;
  user-select: none;
}

/* File Upload Controls (Fields 33 - 50) */
.file-control {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background-color: #ffffff;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  box-sizing: border-box;
}

.file-control:hover {
  border-color: #94a3b8;
}

.file-control:focus-within {
  border-color: #1c68cb;
  box-shadow: 0 0 0 3px rgba(28, 104, 203, 0.14);
}

.file-control__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 5;
  margin: 0;
}

.file-control__button {
  background-color: #f1f5f9;
  color: #1e293b;
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  border-right: 1px solid #cbd5e1;
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
}

.file-control:hover .file-control__button {
  background-color: #e2e8f0;
}

.file-control__status {
  padding: 0 14px;
  font-size: 13.5px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  user-select: none;
}

.form-text {
  display: block;
  font-size: 12.5px;
  line-height: 1.4;
  margin-top: 4px;
}

/* Submit Button & Footer Note */
.application-submit-btn {
  background-color: #1c68cb;
  color: #ffffff;
  border: 0;
  border-radius: 6px;
  padding: 10px 36px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  display: inline-block;
  min-width: 180px;
  box-shadow: 0 4px 14px rgba(28, 104, 203, 0.25);
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.application-submit-btn:hover {
  background-color: #1657ab;
  box-shadow: 0 6px 18px rgba(28, 104, 203, 0.35);
  transform: translateY(-1px);
}

.application-submit-btn:active {
  transform: translateY(0);
}

.contact-link {
  color: #1c68cb;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.contact-link:hover {
  color: #1657ab;
}

/* Date Picker Control */
.date-control {
  position: relative;
  min-width: 0;
  width: 100%;
}

.date-control__text {
  padding-right: 42px !important;
}

.date-control__button {
  position: absolute;
  top: 1px;
  right: 1px;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0 3px 3px 0;
  color: #334155;
  background: #ffffff;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.date-control__button:hover {
  background: #f1f5f9;
  color: #1c68cb;
}

.date-control__button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.date-control__picker {
  position: absolute;
  right: 18px;
  bottom: 4px;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.date-picker[hidden] {
  display: none;
}

.date-picker {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  width: 240px;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #0f172a;
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(28, 104, 203, 0.18), 0 4px 10px rgba(0, 0, 0, 0.08);
}

.date-picker__header,
.date-picker__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.date-picker__header {
  margin-bottom: 8px;
}

.date-picker__title {
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
}

.date-picker__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 4px;
  color: #1c68cb;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
}

.date-picker__nav:hover {
  background: #eff6ff;
}

.date-picker__weekdays,
.date-picker__days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

.date-picker__weekdays {
  margin-bottom: 4px;
}

.date-picker__weekdays span {
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  padding: 2px 0;
}

.date-picker__day {
  width: 100%;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #0f172a;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
}

.date-picker__day:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.date-picker__day.is-other-month {
  color: #94a3b8;
}

.date-picker__day.is-today {
  border-color: #1c68cb;
  font-weight: 600;
}

.date-picker__day.is-selected {
  background: #1c68cb;
  color: #ffffff;
  border-color: #1c68cb;
  font-weight: 600;
}

.date-picker__footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}

.date-picker__footer button {
  padding: 4px 8px;
  border: 0;
  border-radius: 4px;
  font-size: 12px;
  color: #1c68cb;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
}

.date-picker__footer button:hover {
  background: #eff6ff;
}

/* Submission Result Modal / Card */
.application-result {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background-color: #f0fdf4;
  color: #166534;
  text-align: center;
}

.application-result[hidden] {
  display: none;
}

.application-result__icon {
  width: 48px;
  height: 48px;
  line-height: 48px;
  background: #22c55e;
  color: #ffffff;
  border-radius: 50%;
  font-size: 24px;
  font-weight: 700;
  margin: 0 auto 12px;
}

.application-result__title {
  font-size: 20px;
  font-weight: 700;
  color: #14532d;
  margin: 0 0 8px;
}

.application-result__text {
  font-size: 14.5px;
  line-height: 1.55;
  color: #166534;
  margin: 0 0 20px;
  max-width: 580px;
  margin-inline: auto;
}

.application-result__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-result-action {
  padding: 9px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s ease;
}

.btn-result-email {
  background-color: #1c68cb;
  color: #ffffff;
  border: 1px solid #1c68cb;
}

.btn-result-email:hover {
  background-color: #1657ab;
  color: #ffffff;
}

.btn-result-whatsapp {
  background-color: #25d366;
  color: #ffffff;
  border: 1px solid #25d366;
}

.btn-result-whatsapp:hover {
  background-color: #1ea952;
  color: #ffffff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .application-page {
    padding: 16px 8px 40px;
  }

  .application-body-inner {
    padding: 20px 16px;
  }

  .upload-box {
    margin-left: 0;
  }

  .help-container {
    margin-top: 16px;
  }

  .education-table thead th:first-child {
    display: none;
  }

  .education-table thead th:nth-child(2) {
    width: 100% !important;
  }

  .education-table tbody td.c-fs-sm {
    width: 35%;
  }

  .education-table tbody td:nth-child(2) {
    width: 65%;
  }
}

@media (max-width: 576px) {
  .application-header-bar h1 {
    font-size: 20px;
  }

  .education-table tr {
    display: flex;
    flex-direction: column;
  }

  .education-table tbody td.c-fs-sm {
    width: 100% !important;
    border-bottom: 0;
    padding-bottom: 2px;
    font-weight: 600;
  }

  .education-table tbody td:nth-child(2) {
    width: 100% !important;
    padding-top: 2px;
  }
}
