/* =============================================================================
   Scholarship Calculator — Trigger Button
   Positioned absolutely inside the hero section (top-left corner)
   ============================================================================= */

#scholarship-calc-tab {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 10;
  background: #002868;
  color: #fff;
  border: 1px solid #FFCA00;
  border-radius: 6px;
  padding: 12px 20px;
  cursor: pointer;
  font-family: 'Lato', 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: background 0.2s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.2;
}

#scholarship-calc-tab::after {
  content: '';
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  animation: sc-shine 2.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes sc-shine {
  0%   { left: -75%; }
  100% { left: 150%; }
}

#scholarship-calc-tab:hover {
  background: #BF0A30;
  transform: translateY(-1px);
}

#scholarship-calc-tab .sc-tab-label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.15em;
  color: #FFCA00;
  text-transform: uppercase;
}

#scholarship-calc-tab .sc-tab-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

/* =============================================================================
   Modal Overlay
   ============================================================================= */

#scholarship-calc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#scholarship-calc-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* =============================================================================
   Popup Panel
   ============================================================================= */

#scholarship-calc-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 440px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 60px);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: 'Lato', 'Montserrat', sans-serif;
}

#scholarship-calc-popup.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

/* Header bar */
.sc-header {
  background: #002868;
  color: #fff;
  padding: 16px 56px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  flex-shrink: 0;
}

.sc-header-eyebrow {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #FFCA00;
  margin: 0;
}

.sc-header-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.2;
}

/* Progress bar */
.sc-progress-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  margin-top: 10px;
  border-radius: 2px;
  overflow: hidden;
}

.sc-progress-bar-fill {
  height: 100%;
  background: #FFCA00;
  border-radius: 2px;
  width: 0%;
  transition: width 0.4s ease;
}

/* Close button */
#scholarship-calc-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  padding: 0;
  z-index: 5;
}

#scholarship-calc-close:hover {
  background: rgba(191, 10, 48, 0.8);
  border-color: #fff;
}

/* =============================================================================
   Step Content Area
   ============================================================================= */

.sc-body {
  padding: 24px 24px 20px;
  overflow-y: auto;
  flex: 1;
}

/* All steps hidden by default */
.sc-step {
  display: none;
}

.sc-step.active {
  display: block;
}

/* Step heading */
.sc-step-heading {
  font-size: 17px;
  font-weight: 700;
  color: #002868;
  margin: 0 0 6px;
  line-height: 1.3;
}

.sc-step-subtext {
  font-size: 13px;
  color: #555;
  margin: 0 0 16px;
  line-height: 1.5;
}

.sc-welcome-disclaimer {
  font-size: 12px;
  color: #7a5800;
  background: #fff8e1;
  border-left: 3px solid #FFCA00;
  border-radius: 0 4px 4px 0;
  padding: 10px 12px;
  margin: 0 0 20px;
  line-height: 1.6;
}

/* Option buttons */
.sc-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}

.sc-option-btn {
  width: 100%;
  padding: 14px 18px;
  background: #fff;
  border: 2px solid #002868;
  border-radius: 6px;
  color: #002868;
  font-family: 'Lato', 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.3;
}

.sc-option-btn:hover,
.sc-option-btn:focus {
  background: #002868;
  color: #fff;
  outline: none;
}

.sc-option-btn:focus-visible {
  outline: 3px solid #FFCA00;
  outline-offset: 2px;
}

.sc-option-icon {
  font-size: 20px;
  flex-shrink: 0;
}

/* GPA input */
.sc-gpa-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #002868;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sc-gpa-input-wrap {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.sc-gpa-field {
  flex: 1;
  padding: 12px 14px;
  border: 2px solid #002868;
  border-radius: 6px;
  font-size: 22px;
  font-weight: 700;
  color: #002868;
  text-align: center;
  font-family: 'Lato', 'Montserrat', sans-serif;
  transition: border-color 0.2s ease;
  -moz-appearance: textfield;
}

.sc-gpa-field::-webkit-outer-spin-button,
.sc-gpa-field::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.sc-gpa-field:focus {
  outline: none;
  border-color: #BF0A30;
}

.sc-gpa-hint {
  font-size: 12px;
  color: #777;
  margin-top: 8px;
  margin-bottom: 0;
}

.sc-gpa-error {
  font-size: 12px;
  color: #BF0A30;
  font-weight: 700;
  margin-top: 6px;
  min-height: 18px;
}

.sc-submit-btn {
  padding: 12px 20px;
  background: #002868;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: 'Lato', 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.sc-submit-btn:hover {
  background: #BF0A30;
}

/* =============================================================================
   Result Screen
   ============================================================================= */

.sc-result-scholarship-name {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #002868;
  margin: 0 0 4px;
}

.sc-result-amount {
  font-size: 48px;
  font-weight: 900;
  color: #002868;
  line-height: 1;
  margin: 0 0 4px;
}

.sc-result-period {
  font-size: 14px;
  color: #555;
  margin: 0 0 16px;
}

.sc-result-divider {
  border: none;
  border-top: 2px solid #e8e8e8;
  margin: 16px 0;
}

.sc-result-note {
  font-size: 12px;
  color: #666;
  line-height: 1.6;
  margin: 0 0 20px;
  padding: 10px 12px;
  background: #f5f7fa;
  border-left: 3px solid #002868;
  border-radius: 0 4px 4px 0;
}

/* Ineligible state */
.sc-result-ineligible .sc-result-amount {
  font-size: 20px;
  color: #BF0A30;
}

/* CTA buttons */
.sc-result-ctas {
  display: flex;
  gap: 10px;
}

.sc-cta-btn {
  flex: 1;
  padding: 13px 10px;
  border-radius: 6px;
  font-family: 'Lato', 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
  cursor: pointer;
  border: 2px solid #002868;
}

.sc-cta-btn--primary {
  background: #002868;
  color: #fff;
}

.sc-cta-btn--primary:hover {
  background: #BF0A30;
  border-color: #BF0A30;
  color: #fff;
  text-decoration: none;
}

.sc-cta-btn--secondary {
  background: #fff;
  color: #002868;
}

.sc-cta-btn--secondary:hover {
  background: #002868;
  color: #fff;
  text-decoration: none;
}

/* =============================================================================
   Footer / Back Button
   ============================================================================= */

.sc-footer {
  padding: 12px 24px 16px;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.sc-back-btn {
  background: none;
  border: none;
  color: #002868;
  font-family: 'Lato', 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sc-back-btn:hover {
  color: #BF0A30;
}

.sc-back-btn[hidden] {
  visibility: hidden;
  pointer-events: none;
}

.sc-step-counter {
  font-size: 11px;
  color: #aaa;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* =============================================================================
   Mobile — Full Screen Takeover + Bottom Bar
   ============================================================================= */

/* Mobile bottom bar — hidden on desktop */
#scholarship-calc-mobile-bar {
  display: none;
}

@media (max-width: 640px) {
  /* Hide the hero trigger button on mobile */
  #scholarship-calc-tab {
    display: none;
  }

  /* Show sticky bottom bar */
  #scholarship-calc-mobile-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #002868;
    color: #fff;
    border: none;
    padding: 14px 20px 18px; /* extra bottom padding for safe-area / home bar */
    cursor: pointer;
    width: 100%;
    text-align: left;
    box-shadow: 0 -3px 16px rgba(0, 0, 0, 0.3);
    transition: background 0.2s ease;
    font-family: 'Lato', 'Montserrat', sans-serif;
  }

  #scholarship-calc-mobile-bar:active {
    background: #BF0A30;
  }

  .sc-bar-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    opacity: 0.9;
  }

  .sc-bar-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .sc-bar-eyebrow {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #FFCA00;
    line-height: 1;
  }

  .sc-bar-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
  }

  /* Full-screen popup on mobile */
  #scholarship-calc-popup {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transform: translateY(100%) scale(1);
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  #scholarship-calc-popup.is-open {
    transform: translateY(0) scale(1);
  }

  .sc-header {
    padding: 18px 60px 14px 20px;
  }

  #scholarship-calc-close {
    width: 40px;
    height: 40px;
    font-size: 20px;
    top: 14px;
    right: 14px;
  }

  .sc-result-amount {
    font-size: 40px;
  }

  .sc-result-ctas {
    flex-direction: column;
  }
}
