/* ==========================================================================
   COUNSELLING FORM SECTION STYLES — NEXT-GEN TECH AESTHETIC
   ========================================================================== */

.form-section {
  background-color: var(--color-bg);
  position: relative;
}

.form-wrapper-card {
  background: rgba(14, 20, 36, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 4px solid var(--color-brand);
  border-radius: var(--radius-xl);
  padding: clamp(2rem, 5vw, 3.75rem);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 35px rgba(255, 122, 0, 0.25);
  position: relative;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.form-card-header {
  margin-bottom: 2.5rem;
}

.form-top-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.95rem;
  background-color: rgba(255, 122, 0, 0.12);
  color: #FB923C;
  border: 1px solid rgba(255, 122, 0, 0.35);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  box-shadow: 0 0 15px rgba(255, 122, 0, 0.2);
}

.form-main-title {
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  color: #FFFFFF;
  margin-bottom: 0.85rem;
  letter-spacing: -0.025em;
  font-weight: 900;
}

.form-main-subtitle {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Grid & Inputs */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: 0.885rem;
  font-weight: 500;
  color: #FFFFFF;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.required-star {
  color: #F43F5E;
}

.optional-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-dim);
}

.form-input, .form-select {
  width: 100%;
  padding: 0.95rem 1.15rem;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  background-color: rgba(255, 255, 255, 0.04);
  color: #FFFFFF;
  font-size: 0.975rem;
  transition: all var(--transition-fast);
}

.form-select option {
  background-color: #0D121F;
  color: #FFFFFF;
}

.form-input:focus, .form-select:focus {
  border-color: var(--color-brand);
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(255, 122, 0, 0.25);
  outline: none;
}

.form-group.has-error .form-input,
.form-group.has-error .form-select {
  border-color: #EF4444;
  background-color: rgba(239, 68, 68, 0.1);
}

/* Phone input with country flag / prefix & live tick */
.phone-input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  background-color: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.phone-input-wrap:focus-within {
  border-color: var(--color-brand);
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(255, 122, 0, 0.25);
}

.country-prefix {
  padding: 0.95rem 1rem;
  background-color: rgba(255, 255, 255, 0.06);
  color: #38BDF8;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.9rem;
  border-right: 1.5px solid rgba(255, 255, 255, 0.1);
  user-select: none;
}

.phone-input {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  color: #FFFFFF !important;
  padding-right: 0.5rem;
}

.phone-valid-tick {
  display: none;
  color: #34D399;
  font-weight: 800;
  font-size: 1.15rem;
  padding-right: 1rem;
  text-shadow: 0 0 8px #10B981;
}

.phone-input-wrap.is-valid .phone-valid-tick {
  display: block;
}

/* Day Chip Buttons */
.visit-day-section {
  display: flex;
  flex-direction: column;
}

.day-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.day-chip {
  padding: 0.65rem 1.15rem;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  color: #E2E8F0;
  font-family: var(--font-sans);
  font-size: 0.885rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.day-chip:hover {
  border-color: rgba(255, 122, 0, 0.4);
  background-color: rgba(255, 122, 0, 0.1);
  color: #FFFFFF;
}

.day-chip.is-selected {
  background: rgba(255, 122, 0, 0.2);
  border-color: var(--color-brand);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 0 15px rgba(255, 122, 0, 0.35);
}

/* Quick Course Selection Chips */
.form-course-chips {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.75rem !important;
  justify-content: flex-start;
}

.form-course-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.52rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #E2E8F0;
  font-family: var(--font-sans);
  font-size: 0.825rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  touch-action: manipulation;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.form-course-chip:hover {
  border-color: rgba(255, 122, 0, 0.45);
  background-color: rgba(255, 122, 0, 0.12);
  color: #FFFFFF;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 14px rgba(255, 122, 0, 0.25);
}

.form-course-chip:focus-visible {
  outline: 2px solid #38BDF8;
  outline-offset: 2px;
}

.form-course-chip.is-active {
  color: #FFFFFF;
  font-weight: 700;
  transform: translateY(-1px);
  background: rgba(255, 122, 0, 0.2);
  border-color: var(--color-brand);
  box-shadow: 0 0 16px rgba(255, 122, 0, 0.35);
}

/* Domain-specific energetic active states */
.form-course-chip[data-val="Full Stack"].is-active {
  background: rgba(245, 158, 11, 0.18);
  border-color: #F59E0B;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
}

.form-course-chip[data-val="Data Analytics / Data Science"].is-active {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38BDF8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}

.form-course-chip[data-val="AI / ML"].is-active {
  background: rgba(16, 185, 129, 0.18);
  border-color: #10B981;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.35);
}

.form-course-chip[data-val="Cybersecurity"].is-active {
  background: rgba(37, 99, 235, 0.18);
  border-color: #3B82F6;
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.35);
}

@media (max-width: 480px) {
  .form-course-chips {
    gap: 0.45rem;
  }

  .form-course-chip {
    flex: 1 1 calc(50% - 0.45rem);
    justify-content: center;
    padding: 0.6rem 0.65rem;
    font-size: 0.8rem;
    min-height: 44px;
  }

  .day-chips-grid {
    gap: 0.45rem;
  }

  .day-chip {
    flex: 1 1 calc(50% - 0.45rem);
    text-align: center;
    justify-content: center;
    padding: 0.6rem 0.65rem;
    font-size: 0.82rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .form-cta-btn {
    font-size: clamp(0.85rem, 3.8vw, 1.05rem);
    padding: 0.9rem 1.15rem;
    line-height: 1.25;
    min-height: 52px;
  }
}

/* ==========================================================================
   RESPONSIVE: SMALL & ULTRA-NARROW PHONES (<= 380px & down to 320px)
   ========================================================================== */
@media (max-width: 380px) {
  .form-wrapper-card {
    padding: 1.25rem 0.75rem;
    border-radius: var(--radius-lg);
  }

  .form-card-header {
    margin-bottom: 1.25rem;
  }

  .form-top-badge {
    white-space: normal;
    text-align: center;
    max-width: 100%;
    font-size: 0.72rem;
    padding: 0.35rem 0.65rem;
    line-height: 1.35;
  }

  .form-main-title {
    font-size: 1.35rem;
  }

  .form-main-subtitle {
    font-size: 0.85rem;
    line-height: 1.5;
  }

  .form-course-chips {
    gap: 0.4rem;
  }

  .form-course-chip {
    flex: 1 1 100%;
    white-space: normal;
    text-align: center;
    padding: 0.6rem 0.75rem;
    font-size: 0.82rem;
    min-height: 44px;
  }

  .country-prefix {
    padding: 0.85rem 0.65rem;
    font-size: 0.85rem;
  }

  /* Prevent iOS zoom by keeping font-size 16px */
  .form-input, .form-select, .phone-input {
    padding: 0.85rem 0.75rem;
    font-size: 16px !important;
  }

  .day-chip {
    padding: 0.55rem 0.65rem;
    font-size: 0.8rem;
    min-height: 44px;
  }

  .form-cta-btn {
    font-size: 0.88rem;
    padding: 0.85rem 0.95rem;
    line-height: 1.3;
    min-height: 50px;
  }

  .form-privacy-note {
    font-size: 0.74rem;
    line-height: 1.4;
  }
}

@media (max-width: 340px) {
  .form-wrapper-card {
    padding: 1rem 0.65rem;
  }

  .form-main-title {
    font-size: 1.22rem;
  }

  .country-prefix {
    padding: 0.75rem 0.5rem;
    font-size: 0.82rem;
  }

  .form-input, .form-select, .phone-input {
    padding: 0.75rem 0.65rem;
    font-size: 16px !important;
  }

  .day-chip {
    flex: 1 1 100%;
  }

  .form-cta-btn {
    font-size: 0.82rem;
    padding: 0.8rem 0.75rem;
  }
}

/* Error states */
.error-msg {
  display: none;
  font-size: 0.78rem;
  color: #F87171;
  margin-top: 0.4rem;
  font-weight: 600;
}

.form-group.has-error .error-msg,
.visit-day-section.has-error .error-msg {
  display: block;
}

/* Submit Button & Loader */
.form-submit-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-cta-btn {
  box-shadow: 0 4px 20px rgba(255, 122, 0, 0.45);
  white-space: normal;
  text-align: center;
}

.form-cta-btn:hover {
  box-shadow: 0 8px 30px rgba(255, 122, 0, 0.65);
}

.btn-loader {
  display: none;
  width: 22px;
  height: 22px;
}

.spinner {
  animation: rotate 1s linear infinite;
  width: 22px;
  height: 22px;
  stroke: #FFFFFF;
}

@keyframes rotate {
  100% { transform: rotate(360deg); }
}

button.is-loading .btn-text {
  display: none;
}

button.is-loading .btn-loader {
  display: inline-block;
}

.form-privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--color-text-dim);
  text-align: center;
}

.lock-icon {
  width: 15px;
  height: 15px;
  color: #34D399;
  flex-shrink: 0;
}

/* Success Confirmation State */
.form-success-box {
  text-align: center;
  padding: 2.5rem 1.5rem;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.success-icon-wrap {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem auto;
  border: 2px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.3);
}

.success-icon-wrap svg {
  width: 38px;
  height: 38px;
}

.success-heading {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  color: #FFFFFF;
  margin-bottom: 0.75rem;
  font-weight: 800;
}

.success-sub {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto 2.5rem auto;
  line-height: 1.6;
}

.success-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 440px;
  margin: 0 auto;
}

/* Centered Integrated Brand Logo in Form Header */
.form-brand-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
}

.form-brand-logo-img {
  max-height: 48px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
}

@media (max-width: 640px) {
  .form-brand-logo-img {
    max-height: 40px;
    max-width: 180px;
  }
}
