:root {
  --primary: #1a365d;
  --primary-light: #2c5282;
  --accent: #c05621;
  --accent-soft: #fef3e7;
  --success: #276749;
  --error: #c53030;
  --bg: #f7fafc;
  --card: #ffffff;
  --text: #1a202c;
  --muted: #718096;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(26, 54, 93, 0.08);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* University header (SCSVMV portal style) */
.univ-header {
  background: linear-gradient(180deg, #fff8f0 0%, #fff 40%, #fff5eb 100%);
  border-bottom: 4px solid #e85d04;
  box-shadow: 0 2px 12px rgba(232, 93, 4, 0.12);
  padding: 0.75rem 1rem;
}

.univ-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.univ-header-logo {
  flex-shrink: 0;
}

.univ-header-logo img {
  display: block;
  width: 90px;
  height: auto;
  max-height: 100px;
  object-fit: contain;
}

.univ-header-titles {
  flex: 1;
  text-align: center;
  min-width: 0;
  padding: 0 0.5rem;
}

.univ-header-sanskrit {
  font-family: 'Noto Sans Devanagari', 'Mangal', 'Nirmala UI', serif;
  font-size: clamp(0.85rem, 2.2vw, 1.15rem);
  font-weight: 600;
  color: #8b2500;
  line-height: 1.4;
  margin-bottom: 0.25rem;
}

.univ-header-english {
  font-size: clamp(0.95rem, 2.5vw, 1.35rem);
  font-weight: 700;
  color: #1a365d;
  line-height: 1.25;
  margin: 0 0 0.4rem;
}

.univ-header-portal {
  font-size: clamp(0.8rem, 1.8vw, 1rem);
  font-weight: 600;
  color: #c05621;
  margin: 0;
  line-height: 1.35;
}

.univ-header-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.35rem 0 0;
}

.univ-header-banner {
  flex-shrink: 0;
  max-width: 280px;
}

.univ-header-banner img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 88px;
  object-fit: contain;
  border-radius: 4px;
}

@media (max-width: 768px) {
  .univ-header-inner {
    flex-wrap: wrap;
    justify-content: center;
  }

  .univ-header-logo {
    order: 1;
  }

  .univ-header-titles {
    order: 3;
    flex-basis: 100%;
    padding: 0.25rem 0 0;
  }

  .univ-header-banner {
    order: 2;
    max-width: 200px;
  }

  .univ-header-logo img {
    width: 72px;
  }

  .univ-header-banner img {
    max-height: 64px;
  }
}

@media (max-width: 480px) {
  .univ-header-banner {
    display: none;
  }
}

/* Legacy site-header (success page fallback) */
.site-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 2rem 1.5rem 2.5rem;
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
}

.site-header h1 {
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.site-header .subtitle {
  opacity: 0.9;
  font-size: 0.95rem;
}

/* Info cards */
.info-strip {
  max-width: 720px;
  margin: 1.25rem auto 2rem;
  padding: 0 1rem;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.info-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  text-align: center;
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
}

.info-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(26, 54, 93, 0.12);
}

.info-card .amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.info-card .label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.info-card.highlight {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Main layout */
.main-wrap {
  max-width: 720px;
  margin: 0 auto 3rem;
  padding: 0 1rem;
}

.page-intro {
  max-width: 720px;
  margin: 0 auto 1rem;
  padding: 0 1rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Progress */
.progress-bar-wrap {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 0.75rem;
}

.progress-steps::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 10%;
  right: 10%;
  height: 3px;
  background: var(--border);
  z-index: 0;
}

.progress-fill {
  position: absolute;
  top: 14px;
  left: 10%;
  height: 3px;
  background: var(--primary);
  z-index: 1;
  transition: width var(--transition);
  width: 0%;
  border-radius: 3px;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  position: relative;
  z-index: 2;
  transition: all var(--transition);
}

.step-dot.active {
  background: var(--primary);
  color: #fff;
  transform: scale(1.1);
}

.step-dot.done {
  background: var(--success);
  color: #fff;
}

.step-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--muted);
}

.step-labels span.active {
  color: var(--primary);
  font-weight: 600;
}

/* Form card */
.form-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.form-section {
  padding: 1.75rem 1.5rem;
  display: none;
  animation: fadeSlide 0.4s ease;
}

.form-section.active {
  display: block;
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title .icon {
  width: 28px;
  height: 28px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.section-desc {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

/* Fields */
.field-grid {
  display: grid;
  gap: 1.1rem;
}

.field-grid.two-col {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 560px) {
  .field-grid.two-col {
    grid-template-columns: 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.field label .req {
  color: var(--error);
}

.field input,
.field select,
.field textarea {
  padding: 0.7rem 0.9rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: #fff;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.15);
}

.field input.error,
.field select.error {
  border-color: var(--error);
}

.field-hint {
  font-size: 0.75rem;
  color: var(--muted);
}

.field-error {
  font-size: 0.75rem;
  color: var(--error);
  display: none;
}

.field.error .field-error {
  display: block;
}

/* Radio cards */
.radio-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

@media (max-width: 480px) {
  .radio-group {
    grid-template-columns: 1fr;
  }
}

.radio-card {
  position: relative;
}

.radio-card input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-card label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition);
}

.radio-card input:checked + label {
  border-color: var(--primary);
  background: rgba(26, 54, 93, 0.06);
  color: var(--primary);
}

.radio-card label::before {
  content: '';
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  transition: all var(--transition);
}

.radio-card input:checked + label::before {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: inset 0 0 0 3px #fff;
}

/* Programme toggle */
.programme-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.programme-option input {
  position: absolute;
  opacity: 0;
}

.programme-option label {
  display: block;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
}

.programme-option label strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.programme-option label span {
  font-size: 0.8rem;
  color: var(--muted);
}

.programme-option input:checked + label {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Checkboxes */
.checkbox-field {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 1rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color var(--transition);
}

.checkbox-field:hover {
  border-color: var(--primary-light);
}

.checkbox-field input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--primary);
  flex-shrink: 0;
  cursor: pointer;
}

.checkbox-field span {
  font-size: 0.875rem;
  line-height: 1.5;
}

.checkbox-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Nav buttons */
.form-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--muted);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-submit {
  background: linear-gradient(135deg, var(--accent), #dd6b20);
  color: #fff;
  min-width: 140px;
}

.btn-submit:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

/* Alerts */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.alert-error {
  background: #fff5f5;
  border: 1px solid #feb2b2;
  color: #9b2c2c;
}

.alert-success {
  background: #f0fff4;
  border: 1px solid #9ae6b4;
  color: #22543d;
}

/* Success page */
.success-page {
  text-align: center;
  padding: 3rem 1.5rem;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: #c6f6d5;
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 1.5rem;
  animation: pop 0.5s ease;
}

@keyframes pop {
  0% { transform: scale(0); }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.summary-box {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: left;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-row dt {
  color: var(--muted);
  font-weight: 500;
}

.summary-row dd {
  font-weight: 600;
  text-align: right;
  max-width: 55%;
  word-break: break-word;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 32, 44, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-overlay.show {
  display: flex;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.footer-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 1rem;
  max-width: 720px;
  margin: 0 auto;
}
