/* 1:1 Exact PDF Style Sheet - Redesigned Desktop & Reusable Mobile */

:root {
  --primary-color: #4B2683;
  --primary-hover: #5E32A1;
  --secondary-color: #F58A00;
  --bg-canvas: #FFFFFF;
  --bg-page-desktop: #f4f4f4;
  --bg-page-mobile: #FFFFFF;
  --text-color: #1A1A1A;
  --text-sub: #666666;
  --border-color: #B8B8B8;
  --error-color: #D32F2F;
}

/* Global Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-color);
  min-height: 100vh;
}

.section-divider {
  grid-column: span 2;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  margin: 45px 0;
  height: 0;
}

/* Common Title Bar Style for Montserrat */
.title-bar {
  background-color: #4C2485;
  color: #FFFFFF;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  text-align: center;
  border-radius: 0;
}

/* ========================================== */
/* DESKTOP STYLES (Fixed Width 1:1 PDF Copy)  */
/* ========================================== */
@media (min-width: 768px) {
  body {
    background-color: var(--bg-page-desktop);
    display: block;
    padding: 0;
  }

  /* Centered form canvas, max-width 1450px */
  .form-canvas {
    width: 92%;
    max-width: 1450px;
    background-color: var(--bg-canvas);
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #E8E8E8;
    display: flex;
    flex-direction: column;
    padding: 40px 50px 60px 50px;
    margin-top: 36px;
    margin-bottom: 36px;
    margin-left: auto;
    margin-right: auto;
  }

  #exactAdmissionForm {
    padding: 0;
  }

  /* Top-Right Accent design */
  .corner-accent {
    position: absolute;
    top: 0;
    right: 0;
    width: 72px;
    height: 72px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 72 72' width='72' height='72'%3E%3Cpolygon points='72,0 72,72 52,72 52,40 20,72 0,72 0,52 32,20 0,20 0,0' fill='%23F58A00'/%3E%3C/svg%3E");
    background-size: cover;
    pointer-events: none;
    z-index: 10;
  }

  /* Common Title Bar Style for Montserrat, 260px x 62px */
  .title-bar {
    width: 260px;
    height: 62px;
    line-height: 62px;
  }

  /* Desktop Header Layout (1200px+) */
  @media (min-width: 1200px) {
    .form-header {
      position: relative;
      height: 240px;
      margin-bottom: 45px;
      /* Divider margin 45px */
      display: block;
      padding: 0;
      background-color: #FFFFFF;
      border-bottom: 1px solid rgba(0, 0, 0, 0.15);
      width: 100%;
    }

    .logo-image {
      position: absolute;
      top: 16px;
      left: 0;
      width: 340px;
      height: auto;
      display: block;
    }

    .title-bar-wrapper {
      position: absolute;
      bottom: 55px;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      justify-content: center;
      width: 260px;
      height: 62px;
      margin: 0;
    }
  }

  /* Tablet Header Layout (768px - 1199px) */
  @media (max-width: 1199px) {
    .form-header {
      display: flex;
      flex-direction: column;
      align-items: center;
      margin-top: 16px;
      margin-bottom: 48px;
      width: 100%;
      background-color: #FFFFFF;
      border-bottom: 1px solid #ECECEC;
    }

    .logo-image {
      width: 380px;
      height: auto;
      margin-top: 16px;
      margin-bottom: 36px;
      display: block;
    }

    .title-bar-wrapper {
      display: flex;
      justify-content: center;
      width: 100%;
      margin-bottom: 56px;
    }
  }

  /* Grid Layout: Left Label column, Right Form inputs column */
  .form-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    column-gap: 20px;
    row-gap: 20px;
    align-items: start;
    margin-bottom: 48px;
  }

  /* Labels */
  .field-label {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 800;
    color: #111111;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    padding-top: 14px;
    /* Align with 52px input content */
    line-height: 1.3;
  }

  .field-label span.required {
    color: var(--error-color);
    margin-left: 1px;
  }

  .field-label .sub-label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #505050;
    text-transform: none;
    margin-top: 4px;
    line-height: 1.4;
  }

  /* Inputs column container */
  .field-inputs {
    display: flex;
    gap: 16px;
    /* Gap between inline inputs */
    width: 100%;
  }

  .field-inputs.full-width {
    width: 100%;
  }

  .input-group {
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
  }

  /* Inputs Sizes */
  input[type="text"],
  input[type="tel"],
  input[type="email"],
  select {
    height: 52px;
    padding: 0 18px;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
    background-color: #FFFFFF;
    border: 1px solid #B8B8B8;
    border-radius: 0;
    outline: none;
    width: 100%;
    box-shadow: none;
    /* No shadow */
  }

  input::placeholder {
    color: #B8B8B8;
    text-transform: uppercase;
    font-weight: 500;
    font-size: 14px;
  }

  input[type="email"]::placeholder {
    text-transform: none;
  }

  input:focus,
  select:focus {
    border-color: var(--primary-color);
  }

  /* Custom dropdown chevron arrow */
  select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23707070'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
    background-size: 18px;
    padding-right: 48px;
  }

  /* Gender & DOB Inline block row */
  .inline-row {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
  }

  .gender-box {
    flex: 1;
  }

  .dob-label-wrapper {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .dob-label-wrapper label {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 800;
    color: #111111;
    text-transform: uppercase;
    letter-spacing: 0.2px;
  }

  .dob-box {
    flex: 1;
    position: relative;
  }

  .dob-box input {
    width: 100%;
    padding-right: 36px;
  }

  .dob-box .calendar-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #707070;
    font-size: 13px;
    pointer-events: none;
  }

  /* Address layout vertical stack */
  .address-block {
    flex-direction: column;
    gap: 16px !important;
    width: 100%;
  }

  .address-row {
    display: flex;
    gap: 16px;
    width: 100%;
  }

  .address-row .input-group {
    flex: 1;
  }

  /* Terms and Conditions full width */
  .terms-container {
    grid-column: span 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .terms-container h3 {
    font-size: 12px;
    font-weight: 800;
    color: var(--primary-color);
    text-transform: uppercase;
  }

  .terms-paragraphs {
    font-size: 12px;
    color: var(--text-sub);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-weight: 500;
  }

  .terms-paragraphs .highlight {
    color: var(--secondary-color);
    font-weight: 700;
  }

  .checkbox-box {
    margin-top: 8px;
  }

  /* Custom Checkbox */
  .custom-checkbox {
    display: flex;
    align-items: flex-start;
    position: relative;
    cursor: pointer;
    user-select: none;
  }

  .custom-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
  }

  .checkmark {
    position: relative;
    top: 2px;
    height: 14px;
    width: 14px;
    background-color: #FFFFFF;
    border: 1px solid var(--border-color);
    margin-right: 10px;
    flex-shrink: 0;
  }

  .custom-checkbox input:checked~.checkmark::after {
    display: block;
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid var(--primary-color);
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
  }

  .checkbox-text {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-sub);
    line-height: 1.4;
  }

  /* Submit Container alignment */
  .submit-container {
    grid-column: span 2;
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }

  /* Submit Button: Height 48px, Right-aligned */
  #submitBtn {
    background-color: var(--primary-color);
    color: #FFFFFF;
    border: none;
    border-radius: 4px;
    width: 160px;
    height: 48px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s;
  }

  #submitBtn:hover {
    background-color: var(--primary-hover);
  }

  /* Validation error decorations */
  input.is-invalid,
  select.is-invalid {
    border: 1.5px solid var(--error-color) !important;
  }

  .error-msg {
    color: var(--error-color);
    font-family: 'Inter', sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .error-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    border: 1.2px solid var(--error-color);
    border-radius: 50%;
    font-size: 7px;
    font-weight: 900;
    text-align: center;
  }

  .checkbox-error .error-msg {
    margin-left: 24px;
  }

  /* Canvas Footer sits flush inside the container bottom */
  .canvas-footer {
    width: 100%;
    margin-left: 0;
    margin-top: 40px;
  }

  .footer-orange-line {
    width: 100%;
    height: 6px;
    background-color: var(--secondary-color);
  }

  .footer-purple-strip {
    background-color: var(--primary-color);
    color: #FFFFFF;
    padding: 20px 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11.5px;
    font-weight: 500;
  }

  .footer-social {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .footer-social a {
    color: #FFFFFF;
    font-size: 14px;
    display: inline-flex;
    text-decoration: none;
  }

  .social-text {
    margin-left: 6px;
  }

  .footer-website {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .footer-website a {
    color: #FFFFFF;
    text-decoration: none;
    font-weight: 600;
  }
}


/* ========================================== */
/* MOBILE STYLES (Keep 100% Unchanged)        */
/* ========================================== */
@media (max-width: 1024px) {
  body {
    background-color: var(--bg-page-desktop);
    display: block;
    padding: 0;
  }

  .form-canvas {
    width: 95%;
    max-width: 1024px;
    padding: 40px;
    margin-top: 36px;
    margin-bottom: 36px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .05);
    border: 1px solid #E8E8E8;
  }

  .form-header {
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border-bottom: 1px solid #ECECEC;
    margin-bottom: 36px;
    padding-bottom: 36px;
    width: 100%;
  }

  .logo-image {
    position: static;
    width: 300px;
    height: auto;
    margin-top: 16px;
    margin-bottom: 24px;
    display: block;
  }

  .title-bar-wrapper {
    position: static;
    transform: none;
    display: flex;
    justify-content: center;
    width: 220px;
    height: 52px;
    margin: 0 auto;
  }

  .title-bar {
    width: 220px;
    height: 52px;
    line-height: 52px;
  }

  .form-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    column-gap: 32px;
    row-gap: 20px;
  }

  input[type="text"],
  input[type="tel"],
  input[type="email"],
  select {
    height: 52px;
    padding: 0 16px;
  }
}

@media (max-width: 768px) {
  body {
    background-color: var(--bg-page-mobile);
    padding: 0;
  }

  .form-canvas {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 16px 0;
    box-shadow: none;
    border: none;
    overflow-x: hidden;
    background-color: var(--bg-canvas);
    position: relative;
    display: flex;
    flex-direction: column;
  }

  .form-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding-left: 0;
    padding-top: 0;
    padding-bottom: 0;
    width: 100%;
    height: auto;
    border-bottom: 1px solid #ECECEC;
    margin-bottom: 18px;
    order: 1;
  }

  #exactAdmissionForm {
    order: 2;
    margin-top: 10px;
  }

  .canvas-footer {
    order: 3;
  }

  .logo-image {
    width: 190px;
    max-width: 190px;
    margin: 10px;
    display: block;
    height: auto;
    object-fit: contain;
  }

  .title-bar-wrapper {
    margin-top: 60px;
    /* Logo -> Button: 10px */
    margin-bottom: 15px;
    /* Button -> Divider: 18px */
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .title-bar {
    width: 210px;
    height: 40px;
    line-height: 40px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.4px;
  }

  .form-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 16px;
    /* Section spacing: 16px */
  }

  .field-label {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 20px;
    letter-spacing: 0.2px;
    color: #111111;
    margin-bottom: 6px;
    /* Label -> Input: 6px */
    padding-top: 0;
  }

  .field-label span.required {
    color: #E63B3B;
  }

  .field-label .sub-label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 400;
    color: #5A5A5A;
    margin-top: 2px;
    /* Sub-label margin-top: 2px */
    margin-bottom: 6px;
    text-transform: none;
  }

  .field-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-bottom: 16px;
    /* Spacing between blocks: 16px */
  }

  .input-group {
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
  }

  input[type="text"],
  input[type="tel"],
  input[type="email"],
  select {
    height: 42px;
    padding-left: 14px;
    padding-right: 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 400;
    border: 1px solid #D9D9D9;
    background: #ffffff;
    border-radius: 0;
    outline: none;
    width: 100%;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
  }

  input::placeholder {
    color: #B5B5B5;
    font-size: 14px;
  }

  input:focus,
  select:focus {
    border-color: var(--primary-color);
  }

  select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23707070'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    padding-right: 36px;
  }

  .inline-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .gender-box,
  .dob-box {
    width: 100%;
  }

  .dob-label-wrapper {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 4px;
    margin-bottom: 6px;
  }

  .dob-label-wrapper label {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #111111;
    text-transform: uppercase;
    letter-spacing: 0.2px;
  }

  .dob-box {
    position: relative;
  }

  .dob-box input {
    height: 42px;
    padding-right: 42px;
  }

  .dob-box .calendar-icon {
    position: absolute;
    right: 16px;
    /* Icon spacing: 16px from right edge */
    font-size: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #707070;
    pointer-events: none;
  }

  .address-block {
    display: flex;
    flex-direction: column;
    gap: 10px !important;
  }

  .address-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .section-divider {
    border-top: 1px solid rgba(0, 0, 0, 0.15);
    margin-top: 0;
    margin-bottom: 18px;
    height: 0;
  }

  .terms-container {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .terms-container h3 {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
  }

  .terms-paragraphs {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #5E6472;
    line-height: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .terms-paragraphs .highlight {
    color: var(--secondary-color);
    font-weight: 700;
  }

  .checkbox-box {
    margin-top: 10px;
  }

  .custom-checkbox {
    display: flex;
    align-items: flex-start;
    position: relative;
    cursor: pointer;
    gap: 10px;
  }

  .custom-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
  }

  .checkmark {
    position: relative;
    top: 3px;
    height: 15px;
    width: 15px;
    background-color: #FFFFFF;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
  }

  .custom-checkbox input:checked~.checkmark::after {
    display: block;
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid var(--primary-color);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
  }

  .checkbox-text {
    font-size: 13px;
    font-weight: 500;
    color: #333333;
    line-height: 1.5;
  }

  .submit-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 55px;
    margin-bottom: 20px;
  }

  #submitBtn {
    background-color: var(--primary-color);
    color: #FFFFFF;
    border: none;
    width: 180px;
    height: 46px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
  }

  input.is-invalid,
  select.is-invalid {
    border: 1.5px solid var(--error-color) !important;
  }

  .error-msg {
    color: var(--error-color);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .error-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    border: 1.2px solid var(--error-color);
    border-radius: 50%;
    font-size: 7px;
    font-weight: 900;
    text-align: center;
  }

  .checkbox-error .error-msg {
    margin-left: 25px;
  }

  .canvas-footer {
    width: 100%;
    margin-top: 16px;
    margin-left: -16px;
    margin-right: -16px;
    width: calc(100% + 32px);
  }

  .footer-orange-line {
    width: 100%;
    height: 6px;
    background-color: var(--secondary-color);
  }

  .footer-purple-strip {
    background-color: var(--primary-color);
    color: #FFFFFF;
    padding: 20px 24px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    font-size: 11px;
  }

  .footer-social {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
  }

  .footer-social a {
    color: #FFFFFF;
    font-size: 14px;
    display: inline-flex;
    text-decoration: none;
  }

  .social-text {
    margin-left: 6px;
  }

  .footer-website {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .footer-website a {
    color: #FFFFFF;
    text-decoration: none;
    font-weight: 600;
  }

  .corner-accent {
    position: absolute;
    top: 0;
    right: 0;
    width: 42px;
    height: 42px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 72 72' width='72' height='72'%3E%3Cpolygon points='72,0 72,72 52,72 52,40 20,72 0,72 0,52 32,20 0,20 0,0' fill='%23F58A00'/%3E%3C/svg%3E");
    background-size: cover;
    pointer-events: none;
    z-index: 10;
  }
}

/* ========================================== */
/* SHARED SUCCESS MODAL (Across both layouts) */
/* ========================================== */
.success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 100;
}

.success-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.success-card {
  background-color: #FFFFFF;
  padding: 35px;
  text-align: center;
  max-width: 380px;
  width: 90%;
  border: 1px solid #D9D9D9;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.success-overlay.active .success-card {
  transform: translateY(0);
}

.success-checkmark-wrapper {
  width: 60px;
  height: 60px;
  position: relative;
  margin: 0 auto 20px;
}

.success-checkmark-wrapper .circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid var(--primary-color);
}

.success-checkmark-wrapper .check {
  position: absolute;
  top: 26px;
  left: 17px;
  width: 10px;
  height: 18px;
  border: solid var(--primary-color);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
  transform-origin: 0% 100%;
}

.success-card h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.success-card p {
  font-size: 12px;
  color: #666666;
  line-height: 1.4;
  margin-bottom: 20px;
}

#closeSuccessBtn {
  background-color: var(--primary-color);
  color: #FFFFFF;
  border: none;
  border-radius: 0;
  padding: 8px 24px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

#closeSuccessBtn:hover {
  background-color: var(--primary-hover);
}