/* =====================================================
   EXAM REGISTRATION — Complete Redesign
   Fresh modern design with full responsiveness
   ===================================================== */

/* ── Form Container ── */
.exam-form-wrap {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 3rem 3rem 2.5rem;
  border: 1px solid var(--gray-100);
  box-shadow: 0 4px 24px rgba(15, 26, 42, 0.06), 0 1px 3px rgba(15, 26, 42, 0.04);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.4s ease;
}
.exam-form-wrap::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-600), #6366f1);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

/* ── Form Header ── */
.exam-form-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--gray-100);
}
.exam-form-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--blue-500), #6366f1);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--white);
  margin: 0 auto 1rem;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}
.exam-form-header h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--gray-900);
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}
.exam-form-header p {
  font-size: 0.9rem;
  color: var(--gray-500);
  line-height: 1.5;
}

/* =====================================================
   WIZARD STEP INDICATORS
   ===================================================== */
.exam-wizard-steps {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin-bottom: 2.25rem;
  position: relative;
  gap: 0;
}
.wizard-step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  max-width: 160px;
}
.step-number {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--white);
  border: 2.5px solid var(--gray-200);
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.step-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color 0.3s ease;
  text-align: center;
  white-space: nowrap;
}

/* Active step */
.wizard-step.active .step-number {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: var(--white);
  box-shadow: 0 0 0 4px rgba(30, 93, 232, 0.15);
}
.wizard-step.active .step-label {
  color: var(--blue-700);
  font-weight: 700;
}

/* Completed step */
.wizard-step.completed .step-number {
  background: #16a34a;
  border-color: #16a34a;
  color: var(--white);
}
.wizard-step.completed .step-label {
  color: #16a34a;
}

/* Connector lines */
.wizard-connector {
  flex: 1;
  height: 3px;
  background: var(--gray-200);
  align-self: center;
  margin-top: -12px;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  max-width: 120px;
}
.wizard-connector::after {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0;
  background: #16a34a;
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.wizard-connector.filled::after {
  width: 100%;
}

/* =====================================================
   SECTION LABELS (Step headers)
   ===================================================== */
.exam-section-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 1.5rem;
  margin-top: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--gray-100);
}
.exam-section-label .section-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
  color: var(--white);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(30, 93, 232, 0.2);
}

/* =====================================================
   FORM GRID & FIELDS
   ===================================================== */
.exam-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1.5rem;
}
.exam-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.exam-form-group.efg-full {
  grid-column: 1 / -1;
}
.exam-form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-left: 2px;
}
.exam-form-group .req {
  color: var(--danger);
  margin-left: 2px;
}
.exam-form-group input,
.exam-form-group select,
.exam-form-group textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--gray-900);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  transition: all 0.25s ease;
}
.exam-form-group input::placeholder,
.exam-form-group textarea::placeholder {
  color: var(--gray-400);
}
.exam-form-group input:hover,
.exam-form-group select:hover,
.exam-form-group textarea:hover {
  border-color: var(--gray-300);
}
.exam-form-group input:focus,
.exam-form-group select:focus,
.exam-form-group textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(30, 93, 232, 0.08);
}
/* Error state */
.exam-form-group input.field-error,
.exam-form-group select.field-error,
.exam-form-group textarea.field-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}
.exam-form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23959da8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}
.exam-form-group textarea {
  resize: vertical;
  min-height: 100px;
}
.exam-field-error {
  font-size: 0.75rem;
  color: var(--danger);
  display: none;
  margin-top: 0.15rem;
  font-weight: 500;
  padding-left: 2px;
}
.exam-field-error i {
  margin-right: 4px;
  font-size: 0.7rem;
}

/* =====================================================
   UPLOAD ZONES
   ===================================================== */
.upload-zone {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--gray-50);
  position: relative;
}
.upload-zone:hover {
  border-color: var(--blue-300);
  background: rgba(30, 93, 232, 0.02);
}
.upload-zone.has-file {
  border-color: #16a34a;
  background: #f0fdf4;
  border-style: solid;
}
.upload-zone .upload-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--blue-100);
  color: var(--blue-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin: 0 auto 0.75rem;
  transition: all 0.3s ease;
}
.upload-zone:hover .upload-icon {
  background: var(--blue-200);
  transform: translateY(-2px);
}
.upload-zone.has-file .upload-icon {
  background: #dcfce7;
  color: #16a34a;
}
.upload-zone .upload-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.25rem;
}
.upload-zone .upload-hint {
  font-size: 0.78rem;
  color: var(--gray-400);
}
.upload-zone .upload-preview-area {
  margin-top: 1rem;
  display: none;
}
.upload-zone.has-file .upload-preview-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.upload-zone .upload-preview-area img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.upload-zone .upload-preview-area .file-info {
  text-align: left;
}
.upload-zone .upload-preview-area .file-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-800);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-zone .upload-preview-area .file-status {
  font-size: 0.72rem;
  color: #16a34a;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.upload-zone .remove-file-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--gray-200);
  color: var(--gray-500);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 3;
}
.upload-zone .remove-file-btn:hover {
  background: #fef2f2;
  border-color: var(--danger);
  color: var(--danger);
}
.upload-zone.has-file .remove-file-btn {
  display: flex;
}

/* =====================================================
   STEP ACTIONS (navigation buttons)
   ===================================================== */
.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-100);
}

/* =====================================================
   STEP TRANSITIONS
   ===================================================== */
.form-step-content {
  display: none;
  animation: stepFadeIn 0.45s ease forwards;
}
.form-step-content.active {
  display: block;
}
@keyframes stepFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =====================================================
   ALERTS — error banner
   ===================================================== */
.adm-alert {
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
  animation: alertSlide 0.35s ease;
}
@keyframes alertSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.adm-alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.adm-alert-error i {
  color: var(--danger);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* =====================================================
   PREVIEW STEP
   ===================================================== */
.preview-section {
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.preview-section h4 {
  font-family: var(--font-serif);
  color: var(--gray-800);
  margin-bottom: 1rem;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--gray-200);
}
.preview-section h4 i {
  color: var(--blue-500);
  font-size: 0.9rem;
}
.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
}
.preview-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.preview-label {
  font-size: 0.7rem;
  color: var(--gray-400);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.preview-value {
  font-size: 0.92rem;
  color: var(--gray-900);
  font-weight: 600;
}
.preview-full {
  grid-column: 1 / -1;
}

/* Preview documents row */
.preview-docs {
  display: flex;
  gap: 1.5rem;
  padding-top: 0.5rem;
}
.preview-doc-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.preview-doc-item img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.preview-doc-item span {
  font-size: 0.68rem;
  color: var(--gray-500);
  font-weight: 700;
  text-transform: uppercase;
}

/* =====================================================
   REGISTRATION CONFIRMATION — Success Banner
   ===================================================== */
.exam-reg-confirmation {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid #bbf7d0;
  padding: 0;
  text-align: center;
  box-shadow: 0 12px 40px rgba(22, 163, 74, 0.12);
  position: relative;
  overflow: hidden;
  max-width: 600px;
  margin: 0 auto;
}

.exam-reg-confirmation::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, #10b981, #34d399, #10b981);
}

.erc-success-banner {
  padding: 3.5rem 3rem 3rem;
  background: radial-gradient(circle at top, #f0fdf4 0%, var(--white) 100%);
}

.erc-success-banner .erc-icon {
  width: 80px;
  height: 80px;
  background: #dcfce7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  animation: celebrationPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 0 10px rgba(220, 252, 231, 0.5);
}
.erc-success-banner .erc-icon i {
  font-size: 2.5rem;
  color: #16a34a;
}
@keyframes celebrationPop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
.erc-success-banner h3 {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: #14532d;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}
.erc-success-banner .erc-subtitle {
  font-size: 1.05rem;
  color: #166534;
  margin-bottom: 2rem;
  opacity: 0.9;
  line-height: 1.6;
}
.erc-success-banner .erc-subtitle strong {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.4rem 1rem;
  background: #dcfce7;
  border-radius: var(--radius-full);
  color: #15803d;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  border: 1px solid #bbf7d0;
}

.erc-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.erc-actions .btn {
  padding: 0.85rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: #16a34a;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3);
}
.erc-actions .btn:hover {
  background: #15803d;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.4);
}

/* ============================================
   ADMIT CARD / CERTIFICATE — PDF Content
   Hidden on screen, shown only during PDF generation
   ============================================ */
#pdf-certificate-content {
    width: 794px;
    min-width: 794px;
    background: #fff;
    color: #000;
    font-family: 'Times New Roman', Times, serif;
    padding: 40px 40px 30px;
    text-align: left;
    font-size: 13px;
    line-height: 1.45;
}

/* Header */
.ac-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 4px;
}

.ac-logo {
    flex-shrink: 0;
}

.ac-logo img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.ac-logo-placeholder {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ccc;
    border-radius: 50%;
    background: #f9f9f9;
}

.ac-title-block {
    flex: 1;
}

.ac-school-name {
    font-family: 'Times New Roman', Times, serif;
    font-size: 32px;
    font-weight: bold;
    color: #000;
    margin: 0;
    line-height: 1.1;
}

.ac-session {
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
    margin-top: 2px;
    color: #000;
}

.ac-header-line {
    height: 2px;
    background: linear-gradient(to right, #d4a017, #b8860b, #d4a017);
    margin: 6px 0;
}

/* Body */
.ac-body {
    padding: 10px 0 6px;
}

.ac-body-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 10px;
}

/* QR Codes */
.ac-qr-section {
    display: flex;
    gap: 32px;
}

.ac-qr-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ac-qr-box canvas {
    width: 80px;
    height: 80px;
}

.ac-qr-label {
    font-size: 9px;
    color: #666;
    margin-top: 2px;
}

.ac-exam-code {
    font-size: 12px;
    text-align: center;
    padding-top: 4px;
}

.ac-photo-box {
    width: 110px;
    height: 130px;
    border: 2px solid #333;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ac-photo-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ac-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #999;
    font-size: 11px;
}

/* Info rows */
.ac-info-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.ac-top-row {
    border-bottom: 1px solid #000;
    padding-bottom: 6px;
    margin-bottom: 8px;
}

.ac-info-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.ac-label {
    font-size: 12px;
    font-weight: bold;
}

.ac-value {
    font-size: 13px;
}

.ac-bold {
    font-weight: bold;
}

.ac-divider {
    height: 1px;
    background: #000;
    margin: 6px 0;
}

/* 3-Column Details Grid (matching reference) */
.ac-details-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1.3fr;
    gap: 8px 16px;
}

.ac-details-left,
.ac-details-middle {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ac-details-right {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 10px;
}

.ac-detail-row {
    display: flex;
    gap: 6px;
    align-items: baseline;
}

.ac-label-bold {
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.ac-detail-value {
    font-size: 13px;
    font-weight: bold;
}

.ac-label-right {
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    text-align: right;
    min-width: 90px;
}

.ac-value-right {
    font-size: 13px;
}

.ac-center-name {
    font-size: 16px;
    font-weight: bold;
    margin-top: 2px;
}

.ac-center-addr {
    font-size: 12px;
    color: #333;
}

/* Footer — Declaration, Important Note & Instructions */
.ac-footer-section {
    margin-top: 10px;
    border: 1px solid #000;
    font-size: 11.5px;
}

.ac-declaration {
    padding: 8px 12px;
    border-bottom: 1px solid #000;
}

.ac-decl-title,
.ac-note-title,
.ac-instr-title {
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 4px;
    text-decoration: underline;
}

.ac-declaration p {
    margin-bottom: 8px;
}

.ac-signature-row {
    display: flex;
    gap: 20px;
    border-top: 1px solid #000;
    padding-top: 8px;
}

.ac-sig-block {
    flex: 1;
}

.ac-sig-label {
    font-weight: bold;
    font-size: 11.5px;
}

.ac-sig-line {
    margin-top: 20px;
    border-bottom: 1px dotted #666;
    width: 80%;
}

.ac-important-note {
    padding: 8px 12px;
    border-bottom: 1px solid #000;
}

.ac-important-note p {
    margin-bottom: 2px;
}

.ac-instructions {
    padding: 8px 12px;
}

.ac-instructions ol {
    padding-left: 24px;
    list-style-type: decimal;
}

.ac-instructions ol li {
    margin-bottom: 6px;
    text-align: justify;
    list-style-type: decimal;
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
  body > *:not(.exam-registration-section) { display: none !important; }
  .page-hero, #nav-placeholder, #footer-placeholder, .back-to-top { display: none !important; }
  .exam-form-wrap { border: none !important; box-shadow: none !important; }
  .erc-actions { display: none !important; }
  .exam-reg-confirmation { border: 2px solid #333 !important; }
}

/* =====================================================
   RESPONSIVE — Tablet (768px)
   ===================================================== */
@media (max-width: 768px) {
  .exam-form-wrap {
    padding: 1.75rem 1.5rem 1.5rem;
    border-radius: var(--radius-lg);
  }
  .exam-form-grid {
    grid-template-columns: 1fr;
  }
  .exam-form-group.efg-full {
    grid-column: 1;
  }
  .wizard-step {
    max-width: 120px;
  }
  .wizard-connector {
    max-width: 60px;
  }
  .preview-grid {
    grid-template-columns: 1fr;
  }
  .exam-reg-confirmation {
    padding: 2rem 1.5rem;
  }
  .erc-reg-number {
    font-size: 1.35rem;
    letter-spacing: 2px;
  }
}

/* =====================================================
   RESPONSIVE — Mobile (480px)
   ===================================================== */
@media (max-width: 480px) {
  .exam-form-wrap {
    padding: 1.25rem 1rem 1rem;
    border-radius: var(--radius-md);
  }
  .exam-form-header h3 {
    font-size: 1.2rem;
  }
  .step-number {
    width: 32px;
    height: 32px;
    font-size: 0.78rem;
  }
  .step-label {
    font-size: 0.6rem;
  }
  .wizard-connector {
    max-width: 32px;
    height: 2px;
  }
  .upload-zone {
    padding: 1.25rem 1rem;
  }
  .upload-zone .upload-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  .preview-docs {
    gap: 1rem;
  }
  .preview-doc-item img {
    width: 56px;
    height: 56px;
  }
  .step-actions {
    gap: 0.5rem;
  }
  .step-actions .btn {
    font-size: 0.85rem;
    padding: 0.7rem 1.25rem;
  }
  .exam-reg-confirmation {
    padding: 1.75rem 1rem;
  }
  .erc-reg-number-box {
    min-width: auto;
    padding: 1rem 1.25rem;
  }
  .erc-reg-number {
    font-size: 1.15rem;
    letter-spacing: 1px;
  }
  .erc-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}

/* =====================================================
   RESPONSIVE — Very small phones (360px)
   ===================================================== */
@media (max-width: 360px) {
  .exam-wizard-steps {
    gap: 0;
  }
  .wizard-connector {
    max-width: 20px;
  }
  .step-label {
    font-size: 0.55rem;
    letter-spacing: 0;
  }
}
