/* ==========================================================================
   IOA SRI LANKA (Institute of Analytics, Sri Lanka)
   Student Registration Application Form Styling
   Inspired by IOA Global Design System (ioaglobal.org)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* IOA Global Brand Colors */
  --primary: #663399;           /* Royal RebeccaPurple */
  --primary-hover: #542980;
  --primary-dark: #4b247c;      /* Deep Violet */
  --primary-deep: #1a1025;      /* Darkest Indigo / Slate */
  --primary-light: #f3eef9;     /* Soft Lavender Tint */
  --primary-subtle: #ede5f7;
  
  --accent-gold: #ffca28;       /* Glowing Amber Gold */
  --accent-gold-hover: #e5b31f;
  --accent-gold-light: #fff8e1;
  --accent-rose: #e50068;       /* Vibrant Magenta/Rose */
  --accent-cyan: #0284c7;       /* Tech Accent */
  
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  
  /* Neutral Slate Palette */
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;
  --white:     #ffffff;
  
  /* Typography */
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  
  /* Shadows & Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  
  --shadow-sm: 0 2px 6px rgba(102, 51, 153, 0.06);
  --shadow-md: 0 10px 25px -5px rgba(102, 51, 153, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 35px -5px rgba(26, 16, 37, 0.15), 0 10px 15px -5px rgba(102, 51, 153, 0.08);
  --shadow-glow: 0 0 25px rgba(102, 51, 153, 0.25);
  --shadow-gold: 0 4px 15px rgba(255, 202, 40, 0.35);
  
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--slate-50);
  background-image: 
    radial-gradient(circle at 10% 15%, rgba(102, 51, 153, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 85%, rgba(255, 202, 40, 0.05) 0%, transparent 45%);
  color: var(--slate-800);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Header & Institute Banner
   ========================================================================== */

.top-announcement {
  background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-deep) 100%);
  color: var(--white);
  padding: 8px 24px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--accent-gold);
}

.top-announcement-links {
  display: flex;
  gap: 20px;
}

.top-announcement-links a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.top-announcement-links a:hover {
  color: var(--accent-gold);
}

.cisd-header {
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
}

.brand-logo {
  height: 64px;
  width: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.brand-logo:hover {
  transform: scale(1.03);
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary-deep);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--slate-500);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.brand-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid rgba(102, 51, 153, 0.2);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hotline-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  color: var(--slate-700);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transition: var(--transition-fast);
}

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

.hotline-icon {
  color: var(--primary);
  font-size: 1rem;
}

/* Hero Title Section */
.hero-banner {
  background: linear-gradient(135deg, var(--primary-deep) 0%, var(--primary-dark) 60%, var(--primary) 100%);
  color: var(--white);
  padding: 40px 24px 70px 24px;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.hero-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 200%;
  background: radial-gradient(circle at 75% 30%, rgba(255, 202, 40, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 25% 80%, rgba(229, 0, 104, 0.12) 0%, transparent 40%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--accent-gold);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 16px;
  border-radius: 30px;
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 650px;
  margin: 0 auto;
  font-weight: 400;
}

/* ==========================================================================
   Main Form Container & Multi-Step Wizard
   ========================================================================== */

.main-container {
  max-width: 1040px;
  margin: -40px auto 60px auto;
  padding: 0 20px;
  width: 100%;
  position: relative;
  z-index: 10;
}

.form-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(102, 51, 153, 0.12);
  overflow: hidden;
}

/* Progress Tracker Bar */
.stepper-nav {
  background: var(--slate-900);
  padding: 24px 28px 20px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stepper-list {
  display: flex;
  justify-content: space-between;
  position: relative;
  list-style: none;
}

.stepper-list::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 30px;
  right: 30px;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  z-index: 1;
}

.stepper-progress-fill {
  position: absolute;
  top: 18px;
  left: 30px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-gold) 0%, var(--accent-rose) 100%);
  z-index: 2;
  transition: width 0.4s ease;
  width: 0%;
}

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

.step-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--slate-800);
  border: 2px solid var(--slate-600);
  color: var(--slate-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.step-title {
  margin-top: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate-400);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: var(--transition-fast);
}

.step-item.active .step-circle {
  background: var(--primary);
  border-color: var(--accent-gold);
  color: var(--white);
  box-shadow: 0 0 16px rgba(255, 202, 40, 0.6);
  transform: scale(1.12);
}

.step-item.active .step-title {
  color: var(--accent-gold);
  font-weight: 700;
}

.step-item.completed .step-circle {
  background: var(--success);
  border-color: var(--success);
  color: var(--white);
}

.step-item.completed .step-title {
  color: var(--slate-200);
}

/* Section Containers inside Form */
.form-body {
  padding: 36px 40px;
}

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

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

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

/* Section Header styling */
.section-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--primary-light);
}

.section-banner-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.section-name {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-deep);
}

.section-desc {
  font-size: 0.85rem;
  color: var(--slate-500);
  margin-top: 2px;
}

/* Grid & Inputs */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.col-12 { grid-column: span 12; }
.col-8  { grid-column: span 8; }
.col-6  { grid-column: span 6; }
.col-4  { grid-column: span 4; }
.col-3  { grid-column: span 3; }

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

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--slate-700);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.required-star {
  color: var(--accent-rose);
  font-weight: 700;
  margin-left: 3px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  color: var(--slate-800);
  background: var(--white);
  border: 1.5px solid var(--slate-300);
  border-radius: var(--radius-md);
  outline: none;
  transition: var(--transition-fast);
}

.form-input:hover, .form-select:hover, .form-textarea:hover {
  border-color: var(--slate-400);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3.5px rgba(102, 51, 153, 0.15);
}

.form-input.is-invalid, .form-select.is-invalid, .form-textarea.is-invalid {
  border-color: var(--danger);
  background-color: var(--danger-bg);
}

.field-error-msg {
  font-size: 0.78rem;
  color: var(--danger);
  font-weight: 500;
  display: none;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--slate-500);
  margin-top: 4px;
}

/* Card Selection Tiles for Radio & Checkboxes */
.selection-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.tile-option {
  position: relative;
  display: flex;
}

.tile-option input[type="radio"],
.tile-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.tile-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 12px;
  background: var(--white);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--slate-700);
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
  gap: 6px;
}

.tile-icon {
  font-size: 1.3rem;
  color: var(--slate-400);
  transition: var(--transition-fast);
}

.tile-option:hover .tile-label {
  border-color: var(--primary-dark);
  background: var(--slate-50);
}

.tile-option input:checked + .tile-label {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-deep);
  box-shadow: 0 4px 12px rgba(102, 51, 153, 0.12);
}

.tile-option input:checked + .tile-label .tile-icon {
  color: var(--primary);
  transform: scale(1.1);
}

/* Document Upload Dropzones */
.upload-card {
  background: var(--slate-50);
  border: 1.5px dashed var(--slate-300);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition-fast);
  position: relative;
  display: flex;
  flex-direction: column;
}

.upload-card:hover, .upload-card.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.upload-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.upload-card-info h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--slate-800);
  line-height: 1.3;
}

.upload-card-info p {
  font-size: 0.78rem;
  color: var(--slate-500);
  margin-top: 2px;
}

.dropzone-area {
  border: 1px dashed var(--slate-300);
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.dropzone-area:hover {
  border-color: var(--primary);
}

.dropzone-text {
  font-size: 0.82rem;
  color: var(--slate-600);
}

.dropzone-text strong {
  color: var(--primary);
  text-decoration: underline;
}

.dropzone-hint {
  font-size: 0.72rem;
  color: var(--slate-400);
  margin-top: 4px;
}

.file-preview-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-preview-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.8rem;
}

.file-name-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.file-name-meta span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  font-weight: 500;
}

.file-remove-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9rem;
}

.file-remove-btn:hover {
  background: var(--danger-bg);
}

/* Digital Signature Pad */
.signature-box {
  background: var(--slate-50);
  border: 1.5px solid var(--slate-300);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.signature-canvas-wrapper {
  background: var(--white);
  border: 1.5px dashed var(--slate-300);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  height: 180px;
  touch-action: none;
}

.signature-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

.signature-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  color: var(--slate-400);
  font-size: 0.9rem;
  font-style: italic;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.signature-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.btn-sig-action {
  background: var(--white);
  border: 1px solid var(--slate-300);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--slate-700);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-sig-action:hover {
  background: var(--slate-100);
  color: var(--danger);
  border-color: var(--danger);
}

/* Review & Verification Table */
.review-summary-card {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
}

.review-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--slate-200);
}

.review-section-header h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-deep);
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 16px;
}

.review-item {
  display: flex;
  flex-direction: column;
}

.review-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.review-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--slate-800);
  margin-top: 2px;
  word-break: break-word;
}

/* Agreement Checkbox Card */
.agreement-card {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--white) 100%);
  border: 1.5px solid rgba(102, 51, 153, 0.2);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 24px;
}

.custom-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

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

.custom-checkbox-text {
  font-size: 0.9rem;
  color: var(--slate-700);
  line-height: 1.5;
}

/* Form Action Buttons */
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
  background: var(--slate-50);
  border-top: 1px solid var(--slate-200);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 26px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn-secondary {
  background: var(--white);
  border: 1.5px solid var(--slate-300);
  color: var(--slate-700);
}

.btn-secondary:hover {
  background: var(--slate-100);
  border-color: var(--slate-400);
  color: var(--slate-900);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-deep) 100%);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-submit {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: var(--white);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
  font-size: 1.05rem;
  padding: 14px 34px;
}

.btn-submit:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--slate-900);
  color: var(--white);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 420px;
  animation: slideIn 0.3s ease;
  border-left: 4px solid var(--primary);
}

.toast.toast-error {
  border-left-color: var(--danger);
}

.toast.toast-success {
  border-left-color: var(--success);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Footer */
.cisd-footer {
  margin-top: auto;
  background: var(--primary-deep);
  color: var(--white);
  padding: 30px 24px 20px 24px;
  border-top: 3px solid var(--accent-gold);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--slate-400);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--slate-300);
  text-decoration: none;
  font-size: 0.85rem;
  transition: var(--transition-fast);
}

.footer-links a:hover {
  color: var(--accent-gold);
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .col-8, .col-6, .col-4, .col-3 {
    grid-column: span 12;
  }
  .form-body {
    padding: 24px 20px;
  }
  .form-actions {
    padding: 16px 20px;
    flex-direction: column-reverse;
    gap: 12px;
  }
  .form-actions .btn {
    width: 100%;
  }
  .stepper-nav {
    padding: 16px 12px;
    overflow-x: auto;
  }
  .step-title {
    font-size: 0.65rem;
  }
  .hero-title {
    font-size: 1.7rem;
  }
}
