/* Root Custom Properties for Premium Aesthetics */
:root {
  --primary-dark: hsl(153, 74%, 11%);     /* Deep Forest Green */
  --primary: hsl(153, 68%, 20%);          /* Emerald Green */
  --primary-light: hsl(153, 45%, 45%);    /* Soft Emerald */
  --primary-tint: hsl(153, 35%, 94%);     /* Very Light Green Tint */
  --accent-gold: hsl(45, 75%, 48%);       /* Rich Warm Gold */
  --accent-gold-hover: hsl(45, 80%, 42%); /* Darker Gold for Hovers */
  
  --neutral-dark: hsl(160, 15%, 15%);     /* Dark Charcoal Text */
  --neutral-muted: hsl(160, 8%, 45%);     /* Muted Text */
  --neutral-light: hsl(120, 8%, 97%);     /* Background light gray-green */
  --neutral-white: #ffffff;
  
  --error-color: hsl(0, 75%, 45%);
  --error-bg: hsl(0, 75%, 97%);
  --success-color: hsl(140, 70%, 35%);
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.12);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--neutral-light);
  color: var(--neutral-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background-image: radial-gradient(circle at 10% 20%, rgba(15, 81, 50, 0.04) 0%, transparent 40%),
                    radial-gradient(circle at 90% 80%, rgba(212, 175, 55, 0.04) 0%, transparent 40%);
}

/* App Container */
.app-container {
  width: 100%;
  max-width: 850px;
  margin: 20px auto;
}

/* Main Registration Card */
.registration-card {
  background-color: var(--neutral-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid rgba(15, 81, 50, 0.08);
  position: relative;
}

/* Top Banner Image Section */
.card-banner {
  position: relative;
  height: 250px;
  background-image: url('../images/banner.png');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  padding: 40px;
}

.banner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(7, 47, 29, 0.95) 20%, rgba(15, 81, 50, 0.6) 60%, rgba(0, 0, 0, 0.2) 100%);
  z-index: 1;
}

.banner-content {
  position: relative;
  z-index: 2;
  color: var(--neutral-white);
}

.badge {
  background-color: var(--accent-gold);
  color: var(--primary-dark);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-block;
  margin-bottom: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.banner-content h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.banner-content p {
  font-size: 0.95rem;
  opacity: 0.9;
  font-weight: 300;
  letter-spacing: 0.5px;
}

/* Progress Tracker (Stepper) */
.stepper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 40px;
  background-color: var(--primary-tint);
  border-bottom: 1px solid rgba(15, 81, 50, 0.06);
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  cursor: default;
}

.step-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--neutral-white);
  border: 2px solid var(--neutral-muted);
  color: var(--neutral-muted);
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 8px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--neutral-muted);
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: var(--transition);
}

.step-line {
  flex-grow: 1;
  height: 2px;
  background-color: rgba(160, 160, 160, 0.2);
  margin: 0 10px;
  margin-top: -20px; /* Offset label bottom margin */
  position: relative;
  z-index: 1;
  transition: var(--transition);
}

/* Active and Completed Stepper States */
.step-item.active .step-circle {
  border-color: var(--primary);
  background-color: var(--primary);
  color: var(--neutral-white);
  box-shadow: 0 0 0 4px rgba(15, 81, 50, 0.15);
  font-weight: 700;
}

.step-item.active .step-label {
  color: var(--primary);
}

.step-item.completed .step-circle {
  border-color: var(--accent-gold);
  background-color: var(--accent-gold);
  color: var(--primary-dark);
}

.step-item.completed .step-label {
  color: var(--primary-dark);
}

.step-line.completed {
  background-color: var(--accent-gold);
}

/* Form Container and Transitions */
#registrationForm {
  padding: 40px;
}

.form-step {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Step Header */
.step-header {
  margin-bottom: 30px;
  border-bottom: 2px solid var(--primary-tint);
  padding-bottom: 15px;
}

.step-header h2 {
  font-family: var(--font-heading);
  color: var(--primary-dark);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.step-header p {
  font-size: 0.9rem;
  color: var(--neutral-muted);
}

/* Layout Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 24px;
}

.col-span-2 {
  grid-column: span 2;
}

/* Section Dividers */
.section-divider {
  grid-column: span 2;
  font-family: var(--font-heading);
  color: var(--primary);
  font-weight: 700;
  font-size: 1.05rem;
  margin-top: 30px;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px dashed rgba(15, 81, 50, 0.2);
  display: flex;
  align-items: center;
}

.sub-section-title {
  font-family: var(--font-heading);
  color: var(--neutral-white);
  background: var(--primary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 35px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

/* Form Groups & Inputs */
.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--neutral-dark);
  margin-bottom: 8px;
}

.form-group label .required {
  color: var(--error-color);
  margin-left: 2px;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 12px 16px;
  border: 1.5px solid rgba(160, 160, 160, 0.3);
  border-radius: var(--radius-md);
  color: var(--neutral-dark);
  background-color: var(--neutral-white);
  transition: var(--transition);
  outline: none;
  width: 100%;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(15, 81, 50, 0.08);
}

.form-group textarea {
  resize: vertical;
}

/* Custom Radio Group Buttons */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  padding: 8px 0;
}

.radio-label {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
  font-weight: 500 !important;
}

.radio-label input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.custom-radio {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(160, 160, 160, 0.5);
  margin-right: 8px;
  position: relative;
  background-color: var(--neutral-white);
  transition: var(--transition);
}

.radio-label:hover input ~ .custom-radio {
  border-color: var(--primary-light);
}

.radio-label input:checked ~ .custom-radio {
  border-color: var(--primary);
  background-color: var(--neutral-white);
}

.radio-label input:checked ~ .custom-radio::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary);
}

/* Custom Checkbox */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  font-size: 0.88rem;
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  line-height: 1.4;
  margin-top: 15px;
}

.checkbox-label input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.custom-checkbox {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(160, 160, 160, 0.5);
  margin-right: 10px;
  flex-shrink: 0;
  position: relative;
  background-color: var(--neutral-white);
  transition: var(--transition);
  margin-top: 2px;
}

.checkbox-label:hover input ~ .custom-checkbox {
  border-color: var(--primary-light);
}

.checkbox-label input:checked ~ .custom-checkbox {
  border-color: var(--primary);
  background-color: var(--primary);
}

.checkbox-label input:checked ~ .custom-checkbox::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid var(--neutral-white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Errors & Validation UI */
.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select {
  border-color: var(--error-color);
  background-color: var(--error-bg);
}

.form-group .error-msg {
  display: none;
  font-size: 0.78rem;
  color: var(--error-color);
  margin-top: 5px;
  font-weight: 500;
}

.form-group.has-error .error-msg {
  display: block;
}

/* PDF Upload Cards Grid */
.upload-zone-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.upload-card {
  display: flex;
  align-items: center;
  padding: 18px 20px;
  gap: 14px;
  border: 2px dashed rgba(15, 81, 50, 0.2);
  border-radius: var(--radius-md);
  background-color: var(--primary-tint);
  transition: var(--transition);
  position: relative;
}

.upload-card:hover {
  border-color: var(--primary-light);
  background-color: rgba(15, 81, 50, 0.04);
}

.upload-card.has-file {
  border-style: solid;
  border-color: var(--success-color);
  background-color: rgba(25, 135, 84, 0.03);
}

.upload-card.has-error {
  border-style: solid;
  border-color: var(--error-color);
  background-color: var(--error-bg);
}

.upload-icon {
  color: var(--primary);
  margin-right: 20px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.upload-card.has-file .upload-icon {
  color: var(--success-color);
}

.upload-info {
  flex-grow: 1;
}

.upload-info h3 {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  color: var(--primary-dark);
  font-weight: 600;
  margin-bottom: 2px;
}

.upload-info p {
  font-size: 0.8rem;
  color: var(--neutral-muted);
}

.upload-input-btn {
  margin-left: 20px;
  flex-shrink: 0;
}

.btn-select-file {
  display: inline-block;
  padding: 8px 16px;
  font-family: var(--font-heading);
  background-color: var(--neutral-white);
  border: 1.5px solid var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.btn-select-file:hover {
  background-color: var(--primary);
  color: var(--neutral-white);
  border-color: var(--primary);
}

.upload-input-btn input[type="file"] {
  display: none;
}

.file-preview {
  position: absolute;
  bottom: 8px;
  left: 68px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-name {
  font-size: 0.78rem;
  color: var(--neutral-muted);
  font-weight: 500;
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-card.has-file .file-name {
  color: var(--success-color);
  font-weight: 600;
}

.btn-remove-file {
  background: none;
  border: none;
  color: var(--error-color);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.btn-remove-file:hover {
  color: hsl(0, 80%, 35%);
}

/* Review Wizard Section */
.review-wrapper {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.review-section {
  border: 1px solid rgba(15, 81, 50, 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(248,251,249,1) 100%);
}

.review-section-header {
  background-color: var(--primary-tint);
  padding: 10px 18px;
  color: var(--primary-dark);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(15, 81, 50, 0.08);
}

.review-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.review-table tr {
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.review-table tr:last-child {
  border-bottom: none;
}

.review-table th, 
.review-table td {
  padding: 12px 18px;
  text-align: left;
}

.review-table th {
  width: 30%;
  color: var(--neutral-muted);
  font-weight: 600;
  background-color: rgba(0, 0, 0, 0.01);
  border-right: 1px solid rgba(0, 0, 0, 0.02);
}

.review-table td {
  color: var(--neutral-dark);
  font-weight: 500;
  word-break: break-word;
}

.terms-acceptance {
  background-color: var(--primary-tint);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  border-left: 4px solid var(--accent-gold);
}

/* Navigation Buttons Footer */
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  border-top: 2px solid var(--primary-tint);
  padding-top: 25px;
}

.btn-primary, 
.btn-secondary, 
.btn-submit {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--neutral-white);
  margin-left: auto; /* Push to right if only one button */
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(15, 81, 50, 0.15);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  background-color: var(--neutral-white);
  border: 1.5px solid rgba(160, 160, 160, 0.4);
  color: var(--neutral-muted);
}

.btn-secondary:hover {
  border-color: rgba(160, 160, 160, 0.8);
  color: var(--neutral-dark);
  background-color: var(--neutral-light);
}

.btn-submit {
  background-color: var(--accent-gold);
  color: var(--primary-dark);
  margin-left: auto;
  box-shadow: 0 4px 10px rgba(212, 175, 55, 0.2);
}

.btn-submit:hover {
  background-color: var(--accent-gold-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(212, 175, 55, 0.3);
}

.btn-submit:active {
  transform: translateY(1px);
}

/* Modals Overlay & States */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(7, 47, 29, 0.6);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background-color: var(--neutral-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  width: 100%;
  max-width: 480px;
  text-align: center;
  border: 1px solid rgba(15, 81, 50, 0.08);
  animation: modalScale 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalScale {
  from {
    transform: scale(0.9) translateY(20px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.modal-state {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-state h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--primary-dark);
  margin: 20px 0 10px;
  font-weight: 750;
}

.modal-state p {
  font-size: 0.9rem;
  color: var(--neutral-muted);
  line-height: 1.5;
  margin-bottom: 25px;
}

/* Spinner Animation */
.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--primary-tint);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Success & Error Icons */
.modal-icon-success {
  color: var(--success-color);
  background-color: rgba(25, 135, 84, 0.1);
  width: 85px;
  height: 85px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: pulseSuccess 2s infinite;
}

.modal-icon-error {
  color: var(--error-color);
  background-color: var(--error-bg);
  width: 85px;
  height: 85px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: pulseError 2s infinite;
}

@keyframes pulseSuccess {
  0% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.2); }
  70% { box-shadow: 0 0 0 15px rgba(25, 135, 84, 0); }
  100% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0); }
}

@keyframes pulseError {
  0% { box-shadow: 0 0 0 0 rgba(186, 26, 26, 0.2); }
  70% { box-shadow: 0 0 0 15px rgba(186, 26, 26, 0); }
  100% { box-shadow: 0 0 0 0 rgba(186, 26, 26, 0); }
}

/* RESPONSIVE MEDIA QUERIES */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  .app-container {
    margin: 5px auto;
  }
  
  .card-banner {
    height: 180px;
    padding: 20px;
  }
  
  .banner-content h1 {
    font-size: 1.4rem;
  }
  
  .banner-content p {
    font-size: 0.8rem;
  }
  
  .stepper {
    padding: 20px;
  }
  
  .step-label {
    display: none; /* Hide labels on mobile to save space */
  }
  
  .step-circle {
    margin-bottom: 0;
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }
  
  .step-line {
    margin-top: 0;
  }
  
  #registrationForm {
    padding: 20px;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .col-span-2 {
    grid-column: span 1;
  }
  
  .section-divider {
    grid-column: span 1;
    margin-top: 20px;
  }
  
  .sub-section-title {
    margin-top: 25px;
    font-size: 0.9rem;
  }
  
  .form-actions {
    margin-top: 25px;
    padding-top: 15px;
  }
  
  .review-table th {
    width: 40%;
    padding: 8px 10px;
  }
  
  .review-table td {
    padding: 8px 10px;
  }
  
  .file-preview {
    left: 20px;
    bottom: -22px;
  }
  
  .upload-card {
    padding-bottom: 30px; /* Make space for absolute file preview name */
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .upload-input-btn {
    margin-left: 0;
  }
}

/* Date Select Group Styling */
.date-select-group {
  display: flex;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}

.date-select-group select {
  flex: 1 1 90px;
  min-width: 0;
  background-color: var(--neutral-white);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
