/* ============================================
   ICLS Admission Portal — Elegant Frontend Styles
   ============================================ */

:root {
  --icls-bronze: #B68A35;
  --icls-bronze-dark: #8C6A28;
  --icls-gold: #C9A45D;
  --icls-cream: #FAF8F3;
  --icls-white: #FFFFFF;
  --icls-text: #1a1a1a;
  --icls-text-secondary: #5a5a5a;
  --icls-text-muted: #8a8a8a;
  --icls-border: #e0dcd4;
  --icls-border-light: #f0ece4;
  --icls-success: #2d8a4e;
  --icls-error: #c0392b;
  --icls-radius-sm: 6px;
  --icls-radius: 10px;
  --icls-radius-lg: 14px;
  --icls-shadow: 0 1px 3px rgba(0,0,0,0.04);
  --icls-shadow-md: 0 4px 20px rgba(0,0,0,0.06);
  --icls-shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
  --icls-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.icls-form-wrap {
  max-width: 860px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--icls-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.icls-form-wrap * { box-sizing: border-box; }

/* ---- PROGRESS BAR ---- */
.icls-progress-wrap {
  background: var(--icls-white);
  border-radius: var(--icls-radius-lg);
  padding: 22px 28px 18px;
  margin-bottom: 24px;
  box-shadow: var(--icls-shadow-md);
  border: 1px solid var(--icls-border-light);
}

.icls-progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.icls-progress-labels span {
  font-size: 13px;
  color: var(--icls-text-muted);
  font-weight: 500;
}

.icls-progress-labels strong {
  color: var(--icls-bronze);
  font-size: 22px;
  font-weight: 700;
}

.icls-progress-bar {
  width: 100%;
  height: 10px;
  background: var(--icls-border-light);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}

.icls-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--icls-bronze), var(--icls-gold), var(--icls-bronze));
  background-size: 200% 100%;
  border-radius: 100px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  animation: icls-shimmer 2.5s ease-in-out infinite;
}

@keyframes icls-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.icls-progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12px;
  color: var(--icls-text-muted);
}

.icls-progress-meta span { display: flex; align-items: center; gap: 5px; }
.icls-progress-meta .icls-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--icls-bronze);
}

/* ---- TABS ---- */
.icls-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  background: var(--icls-white);
  border-radius: var(--icls-radius);
  box-shadow: var(--icls-shadow-md);
  border: 1px solid var(--icls-border-light);
  overflow: hidden;
}

.icls-tab {
  flex: 1;
  padding: 16px 8px;
  border: none;
  background: transparent;
  color: var(--icls-text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--icls-transition);
  text-align: center;
  position: relative;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icls-tab:not(:last-child) { border-right: 1px solid var(--icls-border-light); }

.icls-tab:hover {
  background: var(--icls-cream);
  color: var(--icls-text-secondary);
}

.icls-tab.active {
  background: linear-gradient(135deg, var(--icls-bronze), var(--icls-gold));
  color: var(--icls-white);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.1);
}

.icls-tab.completed { color: var(--icls-success); background: rgba(45,138,78,0.04); }
.icls-tab.completed.active { color: var(--icls-white); background: linear-gradient(135deg, var(--icls-bronze), var(--icls-gold)); }

.icls-tab-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--icls-border-light);
  color: var(--icls-text-muted);
  font-size: 11px;
  font-weight: 700;
  margin-right: 6px;
  transition: var(--icls-transition);
}

.icls-tab.active .icls-tab-num { background: rgba(255,255,255,0.25); color: var(--icls-white); }
.icls-tab.completed .icls-tab-num { background: var(--icls-success); color: var(--icls-white); }

/* ---- TAB PANELS ---- */
.icls-tab-panel { display: none; animation: iclsFadeIn 0.35s ease; }
.icls-tab-panel.active { display: block; }

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

/* ---- SECTION HEADERS ---- */
.icls-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--icls-bronze-dark);
  margin: 0 0 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--icls-border-light);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.3px;
}

.icls-section-title::before {
  content: '';
  width: 4px; height: 20px;
  background: linear-gradient(180deg, var(--icls-bronze), var(--icls-gold));
  border-radius: 2px;
  flex-shrink: 0;
}

/* ---- FORM GRID — 2 COLUMNS ---- */
.icls-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
  margin-bottom: 8px;
}

.icls-form-grid .icls-field-full { grid-column: 1 / -1; }

@media (max-width: 640px) {
  .icls-form-grid { grid-template-columns: 1fr; gap: 16px; }
  .icls-tabs { flex-wrap: wrap; }
  .icls-tab { flex: 1 1 45%; font-size: 12px; padding: 14px 6px; }
  .icls-tab-num { display: none; }
}

/* ---- FIELDS ---- */
.icls-field { margin-bottom: 0; }

.icls-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--icls-text-secondary);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.icls-field label .icls-req { color: var(--icls-error); margin-left: 3px; }

.icls-field input[type="text"],
.icls-field input[type="email"],
.icls-field input[type="tel"],
.icls-field input[type="date"],
.icls-field input[type="number"],
.icls-field select,
.icls-field textarea {
  width: 100%;
  padding: 13px 15px;
  border: 1.5px solid var(--icls-border);
  border-radius: var(--icls-radius-sm);
  background: var(--icls-white);
  color: var(--icls-text);
  font-size: 14px;
  font-family: inherit;
  transition: var(--icls-transition);
  outline: none;
  line-height: 1.4;
}

.icls-field input:focus,
.icls-field select:focus,
.icls-field textarea:focus {
  border-color: var(--icls-bronze);
  box-shadow: 0 0 0 4px rgba(182,138,53,0.08);
}

.icls-field input::placeholder,
.icls-field textarea::placeholder { color: #bbb; font-weight: 400; }

.icls-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23B68A35' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.icls-field select option:first-child { color: #bbb; }

.icls-field textarea { min-height: 100px; resize: vertical; }
.icls-field textarea.icls-tall { min-height: 160px; }

/* ---- ERROR ---- */
.icls-field.icls-error input,
.icls-field.icls-error select,
.icls-field.icls-error textarea {
  border-color: var(--icls-error);
  box-shadow: 0 0 0 4px rgba(192,57,43,0.06);
}

.icls-field .icls-error-msg {
  font-size: 12px;
  color: var(--icls-error);
  margin-top: 6px;
  display: none;
  font-weight: 500;
  padding-left: 2px;
}

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

/* ---- RADIO ---- */
.icls-radio-group { display: flex; flex-wrap: wrap; gap: 10px; }

.icls-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1.5px solid var(--icls-border);
  border-radius: var(--icls-radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--icls-text-secondary);
  transition: var(--icls-transition);
  background: var(--icls-white);
  user-select: none;
}

.icls-radio:hover { border-color: var(--icls-bronze); }

.icls-radio input {
  appearance: none;
  width: 18px; height: 18px;
  border: 2px solid var(--icls-border);
  border-radius: 50%;
  margin: 0;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: var(--icls-transition);
}

.icls-radio input:checked {
  border-color: var(--icls-bronze);
  background: var(--icls-bronze);
}

.icls-radio input:checked::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 6px; height: 6px;
  background: var(--icls-white);
  border-radius: 50%;
}

.icls-radio:has(input:checked) {
  border-color: var(--icls-bronze);
  background: rgba(182,138,53,0.04);
  color: var(--icls-bronze-dark);
  font-weight: 600;
}

/* ---- CHECKBOX ---- */
.icls-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border: 1.5px solid var(--icls-border);
  border-radius: var(--icls-radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--icls-text);
  transition: var(--icls-transition);
  background: var(--icls-white);
  line-height: 1.5;
  margin-bottom: 8px;
}

.icls-checkbox:last-child { margin-bottom: 0; }
.icls-checkbox:hover { border-color: var(--icls-bronze); }

.icls-checkbox input {
  appearance: none;
  width: 20px; height: 20px;
  border: 2px solid var(--icls-border);
  border-radius: 5px;
  margin: 1px 0 0;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: var(--icls-transition);
}

.icls-checkbox input:checked {
  border-color: var(--icls-success);
  background: var(--icls-success);
}

.icls-checkbox input:checked::after {
  content: '';
  position: absolute;
  top: 2px; left: 6px;
  width: 5px; height: 10px;
  border: solid var(--icls-white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.icls-checkbox:has(input:checked) {
  border-color: var(--icls-success);
  background: rgba(45,138,78,0.03);
}

/* ---- ACADEMIC TABLE ---- */
.icls-academic-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 28px;
  border-radius: var(--icls-radius-sm);
  overflow: hidden;
  border: 1px solid var(--icls-border);
}

.icls-academic-table th {
  background: linear-gradient(135deg, var(--icls-bronze), var(--icls-gold));
  color: var(--icls-white);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  text-align: left;
}

.icls-academic-table th:first-child { width: 60%; }

.icls-academic-table td {
  padding: 0;
  border-bottom: 1px solid var(--icls-border-light);
}

.icls-academic-table tr:last-child td { border-bottom: none; }

.icls-academic-table td input {
  width: 100%;
  padding: 11px 16px;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--icls-text);
  outline: none;
  font-family: inherit;
}

.icls-academic-table td input::placeholder { color: #bbb; }
.icls-academic-table td input:focus { background: rgba(182,138,53,0.02); }
.icls-academic-table tr:nth-child(even) td { background: var(--icls-cream); }

/* ---- DROPZONE ---- */
.icls-dropzone {
  border: 2px dashed var(--icls-border);
  border-radius: var(--icls-radius-sm);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--icls-transition);
  background: var(--icls-cream);
}

.icls-dropzone:hover {
  border-color: var(--icls-bronze);
  background: rgba(182,138,53,0.02);
}

.icls-dropzone.dragover {
  border-color: var(--icls-bronze);
  background: rgba(182,138,53,0.06);
  transform: scale(1.01);
}

.icls-dropzone .icls-dz-icon {
  width: 28px; height: 28px;
  color: var(--icls-bronze);
  opacity: 0.5;
  margin-bottom: 8px;
}

.icls-dropzone .icls-dz-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--icls-text);
  margin: 0 0 3px;
}

.icls-dropzone .icls-dz-hint {
  font-size: 11px;
  color: var(--icls-text-muted);
  margin: 0;
}

/* ---- ATTACHMENT CARDS ---- */
.icls-attachments-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (max-width: 640px) {
  .icls-attachments-grid { grid-template-columns: 1fr; }
}

.icls-attachment-card {
  background: var(--icls-white);
  border: 1.5px solid var(--icls-border);
  border-radius: var(--icls-radius-sm);
  overflow: hidden;
  transition: var(--icls-transition);
}

.icls-attachment-card:hover { box-shadow: var(--icls-shadow); }
.icls-attachment-card.uploaded { border-color: var(--icls-success); }
.icls-attachment-card.uploaded .icls-attachment-header { background: rgba(45,138,78,0.06); }

.icls-attachment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--icls-cream);
  border-bottom: 1px solid var(--icls-border-light);
}

.icls-attachment-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--icls-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--icls-transition);
  background: var(--icls-white);
}

.icls-attachment-card.uploaded .icls-attachment-check {
  background: var(--icls-success);
  border-color: var(--icls-success);
}

.icls-attachment-check svg {
  width: 11px; height: 11px;
  color: var(--icls-white);
  opacity: 0;
  transform: scale(0);
  transition: var(--icls-transition);
}

.icls-attachment-card.uploaded .icls-attachment-check svg {
  opacity: 1;
  transform: scale(1);
}

.icls-attachment-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--icls-text);
  line-height: 1.3;
}

.icls-attachment-title sup {
  color: var(--icls-bronze);
  font-size: 9px;
  font-weight: 700;
}

.icls-attachment-body { padding: 12px; }
.icls-attachment-body .icls-dropzone { padding: 14px; }
.icls-attachment-body .icls-dz-icon { width: 22px; height: 22px; }

.icls-file-status {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(45,138,78,0.05);
  border-radius: 5px;
  margin-top: 8px;
  border: 1px solid rgba(45,138,78,0.12);
}

.icls-file-status.visible { display: flex; }

.icls-file-name {
  font-size: 12px;
  color: var(--icls-success);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 75%;
}

.icls-file-remove {
  font-size: 11px;
  color: var(--icls-error);
  cursor: pointer;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  transition: var(--icls-transition);
  flex-shrink: 0;
}

.icls-file-remove:hover { background: rgba(192,57,43,0.08); }

/* ---- UNDERTAKING ---- */
.icls-undertaking-box {
  background: var(--icls-cream);
  border: 1px solid var(--icls-border);
  border-radius: var(--icls-radius-sm);
  padding: 22px;
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--icls-text-secondary);
}

.icls-undertaking-box::-webkit-scrollbar { width: 5px; }
.icls-undertaking-box::-webkit-scrollbar-track { background: transparent; }
.icls-undertaking-box::-webkit-scrollbar-thumb { background: var(--icls-bronze); border-radius: 3px; }

.icls-undertaking-box p { margin: 0 0 12px; text-align: justify; }
.icls-undertaking-box p:last-child { margin-bottom: 0; }
.icls-undertaking-box strong { color: var(--icls-bronze-dark); font-weight: 700; }

/* ---- NAV BUTTONS ---- */
.icls-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--icls-border-light);
  gap: 14px;
}

.icls-btn {
  padding: 13px 32px;
  border-radius: var(--icls-radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--icls-transition);
  border: none;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
}

.icls-btn-prev {
  background: var(--icls-white);
  color: var(--icls-text-secondary);
  border: 1.5px solid var(--icls-border);
}

.icls-btn-prev:hover {
  background: var(--icls-cream);
  border-color: var(--icls-bronze);
  color: var(--icls-bronze-dark);
}

.icls-btn-next,
.icls-btn-submit {
  background: linear-gradient(135deg, var(--icls-bronze), var(--icls-gold));
  color: var(--icls-white);
  margin-left: auto;
  box-shadow: 0 3px 14px rgba(182,138,53,0.25);
}

.icls-btn-next:hover,
.icls-btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 20px rgba(182,138,53,0.35);
}

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

/* ---- SPINNER ---- */
.icls-spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: var(--icls-white);
  border-radius: 50%;
  animation: iclsSpin 0.7s linear infinite;
}

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

/* ---- SUCCESS ---- */
.icls-success {
  text-align: center;
  padding: 60px 30px;
  animation: iclsFadeIn 0.5s ease;
}

.icls-success-icon { font-size: 52px; margin-bottom: 18px; }

.icls-success h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--icls-text);
  margin: 0 0 10px;
}

.icls-success p {
  font-size: 15px;
  color: var(--icls-text-secondary);
  line-height: 1.6;
  max-width: 460px;
  margin: 0 auto 20px;
}

.icls-success-ref {
  display: inline-block;
  background: linear-gradient(135deg, var(--icls-bronze), var(--icls-gold));
  color: var(--icls-white);
  padding: 14px 28px;
  border-radius: var(--icls-radius-sm);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: var(--icls-shadow-md);
}

/* ---- NOTES ---- */
.icls-note {
  font-size: 12px;
  color: var(--icls-text-muted);
  margin-top: 20px;
  padding: 14px 18px;
  background: var(--icls-cream);
  border-radius: var(--icls-radius-sm);
  line-height: 1.6;
  border: 1px solid var(--icls-border-light);
}

.icls-note p { margin: 0 0 6px; }
.icls-note p:last-child { margin-bottom: 0; }
.icls-note sup { color: var(--icls-bronze); font-weight: 700; }

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
  .icls-progress-wrap { padding: 16px 18px 14px; }
  .icls-progress-labels strong { font-size: 18px; }
  .icls-nav { flex-direction: column; }
  .icls-btn { width: 100%; }
  .icls-btn-next, .icls-btn-submit { margin-left: 0; }
  .icls-section-title { font-size: 15px; }
  .icls-undertaking-box { max-height: 260px; padding: 16px; }
  .icls-academic-table th { padding: 10px 12px; font-size: 11px; }
  .icls-academic-table td input { padding: 10px 12px; font-size: 13px; }
}

/* ---- ACCESSIBILITY ---- */
.icls-field input:focus-visible,
.icls-field select:focus-visible,
.icls-field textarea:focus-visible,
.icls-btn:focus-visible,
.icls-tab:focus-visible {
  outline: 2px solid var(--icls-bronze);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
