/* ==========================================================================
   ADMISSION ENQUIRY FORM UI STYLES (COMPACT & SLEEK)
   Exact recreation of the MIT-ADT University Admission Form, optimized for
   a compact footprint, clean vertical rhythm, and conversion rate.
   ========================================================================== */

.admission-card-wrapper {
  width: 100%;
  max-width: 375px;
  margin-left: auto;
  position: relative;
  z-index: 10;
}

.admission-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 1.05rem 1.15rem;
  box-shadow: 0 14px 36px -6px rgba(15, 23, 42, 0.22), 0 3px 10px rgba(0, 0, 0, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(10px);
  position: relative;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

@media (max-width: 991.98px) {
  .admission-card-wrapper {
    max-width: 400px;
    margin: 1.25rem auto 0;
  }
}

@media (max-width: 575.98px) {
  .admission-card-wrapper {
    max-width: 100%;
    margin: 1rem auto 0;
  }
  .admission-card {
    padding: 0.95rem 0.95rem;
    border-radius: 12px;
  }
}

.admission-card__header {
  text-align: center;
  margin-bottom: 0.7rem;
  padding-bottom: 0.4rem;
  border-bottom: 1.5px solid #f1f5f9;
}

.admission-card__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #260e40;
  margin: 0;
  letter-spacing: -0.01em;
}

.admission-form {
  display: flex;
  flex-direction: column;
  gap: 0.52rem;
}

/* Individual Form Groups */
.admission-form__group {
  position: relative;
  width: 100%;
}

/* Base Input and Select Styling (Compact 39px height) */
.admission-form__input,
.admission-form__select {
  width: 100%;
  height: 39px;
  background-color: #ffffff;
  border: 1.5px solid #d1d5db;
  border-radius: 7px;
  padding: 0 11px;
  font-size: 0.86rem;
  font-family: inherit;
  color: #1e293b;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 0.15s cubic-bezier(0.4, 0, 0.2, 1), 
              background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.admission-form__input::placeholder {
  color: #64748b;
  font-weight: 400;
}

.admission-form__input:hover,
.admission-form__select:hover {
  border-color: #94a3b8;
}

.admission-form__input:focus,
.admission-form__select:focus {
  border-color: #531170;
  box-shadow: 0 0 0 3px rgba(83, 17, 112, 0.13);
  background-color: #ffffff;
}

/* Valid & Invalid States */
.admission-form__input.is-valid,
.admission-form__select.is-valid,
.admission-form__phone-group.is-valid {
  border-color: #10b981;
  background-color: #fcfdfc;
}

.admission-form__input.is-valid:focus,
.admission-form__select.is-valid:focus,
.admission-form__phone-group.is-valid:focus-within {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}

.admission-form__input.is-invalid,
.admission-form__select.is-invalid,
.admission-form__phone-group.is-invalid {
  border-color: #ef4444;
  background-color: #fef2f2;
}

.admission-form__input.is-invalid:focus,
.admission-form__select.is-invalid:focus,
.admission-form__phone-group.is-invalid:focus-within {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Inline Field Error Message */
.admission-form__field-error {
  display: none;
  font-size: 0.7rem;
  color: #dc2626;
  font-weight: 600;
  margin-top: 2px;
  margin-left: 2px;
  line-height: 1.25;
  animation: fadeInDown 0.18s ease-out;
}

.admission-form__field-error.show {
  display: flex;
  align-items: center;
  gap: 3px;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-2px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Shake Animation on Validation Error */
.field-shake {
  animation: shakeX 0.38s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shakeX {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-2.5px, 0, 0); }
  40%, 60% { transform: translate3d(2.5px, 0, 0); }
}

/* Custom Select Dropdown Styling */
.admission-form__select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 14px;
  padding-right: 32px;
}

.admission-form__select:disabled {
  background-color: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
  border-color: #e2e8f0;
}

/* Mobile Phone Input Group with Country Code */
.admission-form__phone-group {
  display: flex;
  align-items: stretch;
  border: 1.5px solid #d1d5db;
  border-radius: 7px;
  background: #ffffff;
  overflow: hidden;
  height: 39px;
  transition: border-color 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.admission-form__phone-group:hover {
  border-color: #94a3b8;
}

.admission-form__phone-group:focus-within {
  border-color: #531170;
  box-shadow: 0 0 0 3px rgba(83, 17, 112, 0.13);
}

.admission-form__country-code {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  background: #f8fafc;
  border-right: 1px solid #d1d5db;
  color: #334155;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: default;
  user-select: none;
  flex-shrink: 0;
}

.admission-form__flag {
  font-size: 1rem;
  line-height: 1;
}

.admission-form__code-arrow {
  color: #64748b;
  font-size: 0.68rem;
}

.admission-form__phone-group .admission-form__input {
  border: none;
  border-radius: 0;
  height: 100%;
  flex: 1;
  box-shadow: none !important;
  padding: 0 10px;
}

/* Captcha Layout (Two Columns) */
.admission-form__captcha-row {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 0.55rem;
  align-items: start;
}

.admission-form__captcha-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 39px;
  border: 1.5px solid #d1d5db;
  border-radius: 7px;
  background: #fdfefe;
  padding: 2px 5px 2px 7px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.admission-form__captcha-canvas-wrap {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.admission-form__captcha-canvas {
  width: 95px;
  height: 32px;
  display: block;
}

.admission-form__captcha-divider {
  width: 1px;
  height: 22px;
  background-color: #cbd5e1;
  margin: 0 4px;
  flex-shrink: 0;
}

.admission-form__captcha-refresh {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #334155;
  cursor: pointer;
  border-radius: 5px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
  padding: 0;
}

.admission-form__captcha-refresh:hover {
  background-color: #f1f5f9;
  color: #531170;
}

.admission-form__captcha-refresh.rotating svg {
  animation: captchaSpin 0.45s linear;
}

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

/* Consent Checkbox */
.admission-form__consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 0.1rem;
  margin-bottom: 0.1rem;
  cursor: pointer;
}

.admission-form__checkbox {
  width: 15px;
  height: 15px;
  accent-color: #531170;
  margin-top: 1.5px;
  cursor: pointer;
  flex-shrink: 0;
}

.admission-form__consent-text {
  font-size: 0.72rem;
  line-height: 1.35;
  color: #1e293b;
  font-weight: 500;
  user-select: none;
}

/* Submit Button (Compact 41px height) */
.admission-form__btn-submit {
  width: 100%;
  height: 41px;
  background: linear-gradient(135deg, #531170 0%, #3e0954 100%);
  color: #ffffff;
  border: none;
  border-radius: 7px;
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 3px 12px rgba(62, 9, 84, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  margin-top: 0.1rem;
  position: relative;
  overflow: hidden;
}

.admission-form__btn-submit:hover {
  filter: brightness(1.08);
  box-shadow: 0 5px 16px rgba(62, 9, 84, 0.38);
  transform: translateY(-1px);
}

.admission-form__btn-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(62, 9, 84, 0.28);
}

.admission-form__btn-submit:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

/* Button Spinner */
.admission-form__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: submitSpin 0.65s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

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

/* Trust / Privacy Micro-note */
.admission-form__trust-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.69rem;
  color: #64748b;
  margin-top: 0.15rem;
  font-weight: 500;
  text-align: center;
}

.admission-form__trust-note svg {
  color: #10b981;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
}

/* Feedback Notification Banner */
.admission-form__alert {
  padding: 0.6rem 0.85rem;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 500;
  display: none;
  align-items: center;
  gap: 6px;
  margin-bottom: 0.55rem;
  line-height: 1.35;
  animation: fadeInDown 0.25s ease-out;
}

.admission-form__alert--success {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.admission-form__alert--error {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.admission-form__alert.show {
  display: flex;
}

/* Pulse animation when scrolled to via CTA buttons */
.form-focus-pulse .admission-card {
  animation: admissionCardPulse 1.4s ease-out;
}

@keyframes admissionCardPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 14px 36px -6px rgba(15, 23, 42, 0.22);
  }
  30% {
    transform: scale(1.015);
    box-shadow: 0 0 0 5px rgba(83, 17, 112, 0.22), 0 18px 40px rgba(15, 23, 42, 0.3);
  }
}
