:root {
  --bg: #f7f7fb;
  --card: #fff;
  --text: #222;
  --muted: #666;
  /* Brand palette inspired by the logo */
  --primary: #c8a24a; /* gold */
  --primary-600: #9a7a1f; /* darker gold for hover */
  --danger: #dc2626;
  --success: #16a34a;
  --border: #e5e7eb;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 50% -200px, #1f2937 0%, #0f1115 55%, #0b0d10 100%);
  min-height: 100vh;
}
.container {
  max-width: 680px;
  margin: 40px auto;
  padding: 0 16px;
}
h1 {
  text-align: center;
  margin-bottom: 20px;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.form-title { text-transform: uppercase; letter-spacing: 0.3px; }
.section-title { text-align: center; margin: 0 0 12px; font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--primary); }
.form-title { color: var(--primary); }
.brand-info h3, legend { font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.section-title { text-align: center; margin: 0 0 12px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  margin-bottom: 16px;
  border-top: 4px solid var(--primary);
}
.hidden { display: none; }
.field { margin-bottom: 14px; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
input[type="text"], input[type="date"], input[type="email"], input[type="number"], input[type="tel"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(200,162,74,0.25);
}
/* Locked fields after verification */
input[readonly], .readonly {
  background: #eff6ff;
  color: #475569;
  cursor: not-allowed;
}
.field.error label { color: var(--danger); }
.field.error input,
.field.error select,
.field.error textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}
.inline-group.error {
  outline: 2px solid var(--danger);
  background: #fee2e2;
  border-radius: 8px;
  padding: 6px 8px;
}
.req { color: var(--danger); margin-left: 4px; }
.btn {
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color .15s ease, transform .05s ease;
}
.btn:hover { background: var(--primary-600); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn--outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn--outline:hover { background: rgba(200,162,74,0.08); }
a.btn, a.btn:hover, a.btn:focus, a.btn:visited { text-decoration: none; }
.admin .btn { font-size: 15px; padding: 12px 18px; box-shadow: 0 6px 14px rgba(200,162,74,0.25); }
/* Admin-specific text emphasis */
.admin h1 { font-size: 28px; color: #f3f4f6; letter-spacing: 0.3px; }
.admin .card h3 { font-size: 18px; color: #111827; letter-spacing: 0.2px; }
.admin label { color: #111827; font-weight: 700; }
.admin table thead th { background: #f9fafb; color: #111827; font-weight: 700; }
.admin table tbody tr:hover { background: #f9fafb; }
#alerts { margin-bottom: 12px; }
.alert {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid;
}
.alert.error { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.alert.success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }

/* New layout & form styles */
fieldset {
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
}
legend { padding: 4px 8px; font-weight: 700; color: #111827; background: rgba(200,162,74,0.10); border: 1px solid rgba(200,162,74,0.25); border-radius: 6px; }
.muted { color: var(--muted); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.inline-group { display: flex; gap: 12px; align-items: center; }
.inline-group.wrap { flex-wrap: wrap; }
.inline-group label { font-weight: 500; }
.course-with-tip { display: inline-flex; align-items: center; gap: 6px; }
/* Info tooltip icon/button */
.info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  background: #fff;
  color: var(--muted);
  margin-left: 6px;
  cursor: help;
  position: relative;
}
.info-tip:hover, .info-tip:focus {
  color: var(--primary);
  outline: none;
}
.info-tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  width: min(280px, 80vw);
  font-size: 12px;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
  z-index: 20;
}
.info-tip::before {
  content: '';
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #111827;
  opacity: 0;
  transition: opacity .15s ease;
}
.info-tip:hover::after, .info-tip:focus::after,
.info-tip:hover::before, .info-tip:focus::before {
  opacity: 1;
}
.info-tip.open::after, .info-tip.open::before {
  opacity: 1;
}
input[type="radio"], input[type="checkbox"] { margin-right: 6px; accent-color: var(--primary); }

/* Disable CSS pseudo-tooltips when JS tooltips are active */
body.js-tooltips-enabled .info-tip::after,
body.js-tooltips-enabled .info-tip::before,
body.js-tooltips-enabled .info-tip.open::after,
body.js-tooltips-enabled .info-tip.open::before {
  display: none !important;
}

/* JS-managed tooltip popover */
.tooltip-popover {
  position: fixed;
  background: #111827;
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  max-width: min(320px, 90vw);
  width: max-content;
  z-index: 1000;
  opacity: 0;
  transition: opacity .15s ease;
  pointer-events: none; /* enable when visible */
}
.tooltip-popover.visible { opacity: 1; pointer-events: auto; }
.tooltip-popover .tooltip-content { font-size: 12.5px; line-height: 1.35; }
.tooltip-popover .tooltip-arrow {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #111827;
  transform: translateX(-50%) rotate(45deg);
}
.tooltip-popover.bottom .tooltip-arrow { top: -5px; }
.tooltip-popover.top .tooltip-arrow { bottom: -5px; }

/* Brand header */
.brand-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
@media (min-width: 640px) {
  .brand-header { flex-direction: column; }
}
.brand-logo img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 12px;
  display: block;
}
@media (min-width: 640px) {
  .brand-logo img { width: 120px; height: 120px; }
}
.brand-info { text-align: center; }
.brand-info h1 {
  margin: 0 0 4px 0;
  font-size: 22px;
  text-transform: uppercase;
}
.brand-info h3 {
  margin: 0 0 8px 0;
  font-weight: 700;
  color: var(--primary);
}
.brand-info p { margin: 2px 0; font-size: 14px; color: #374151; }
.brand-info a { color: var(--primary); text-decoration: none; }
.brand-info a:hover { text-decoration: underline; }

/* Notification sidebar */
.notify-sidebar {
  position: fixed;
  top: 16px;
  right: 16px;
  width: min(360px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
  pointer-events: none; /* container is passive; items handle interaction */
}
.notify-item {
  background: #fff;
  color: #111827;
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.12);
  padding: 12px 12px 12px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  opacity: 0;
  transform: translateX(16px);
  transition: transform .2s ease, opacity .2s ease;
  pointer-events: auto; /* clickable */
}
.notify-item.enter { opacity: 1; transform: translateX(0); }
.notify-item.exit { opacity: 0; transform: translateX(16px); }
.notify-content { flex: 1; }
.notify-message { margin: 0; font-size: 14px; line-height: 1.35; }
.notify-close {
  background: transparent;
  border: none;
  color: #6b7280;
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: 6px;
}
.notify-close:hover { background: #f3f4f6; color: #111827; }
/* Type colors */
.notify-item.info { border-left-color: var(--primary); }
.notify-item.success { border-left-color: var(--success); background: #ecfdf5; border-color: #d1fae5; }
.notify-item.warning { border-left-color: #f59e0b; background: #fffbeb; border-color: #fde68a; }
.notify-item.error { border-left-color: var(--danger); background: #fef2f2; border-color: #fecaca; }
@media (max-width: 600px) {
  .notify-sidebar {
    right: 8px;
    width: calc(100vw - 16px);
  }
}

/* Modal (Welcome / Instructional) */
.modal.hidden { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
}
.modal .modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: saturate(120%) blur(1px);
}
.modal .modal-content {
  position: relative;
  z-index: 1;
  margin: 8vh auto;
  width: min(720px, 92vw);
  background: #ffffff;
  border: 1px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.18);
  padding: 20px 18px;
  animation: modalIn .18s ease;
}
@media (min-width: 640px) {
  .modal .modal-content { padding: 24px; }
}
.modal .modal-title {
  margin: 0 0 10px 0;
  font-size: 20px;
  color: var(--primary);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.modal .modal-body { color: #111827; line-height: 1.5; }
.modal .modal-actions { margin-top: 16px; display: flex; justify-content: flex-end; gap: 10px; }
.modal .modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: #111827;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.modal .modal-close:hover { background: #f9fafb; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Payment Status Badges */
.payment-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.payment-status-pending {
  background-color: #FEF3C7;
  color: #92400E;
}

.payment-status-paid {
  background-color: #D1FAE5;
  color: #065F46;
}

.payment-status-overdue {
  background-color: #FEE2E2;
  color: #B91C1C;
}

.payment-status-cancelled {
  background-color: #E5E7EB;
  color: #1F2937;
}

/* Responsive enhancements for Admin Notices and general layout */
.card {
  width: 100%;
  box-sizing: border-box;
}

.card .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.card .actions .right {
  margin-left: auto;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

/* Density helpers for #ant-table */
#ant-table.dense th,
#ant-table.dense td { padding: 6px 8px; font-size: 12px; }
#ant-table.loose th,
#ant-table.loose td { padding: 12px 14px; }

/* Controls area labels and inputs alignment */
.actions.controls label {
  display: block;
  font-size: 12px;
  color: var(--muted, #666);
}
.actions.controls select,
.actions.controls input[type="text"],
.actions.controls input[type="search"] {
  min-height: 32px;
}

/* Breakpoint: large tablets and small laptops */
@media (max-width: 1200px) {
  #ant-table th,
  #ant-table td { font-size: 14px; }
}

/* Breakpoint: tablets */
@media (max-width: 992px) {
  .actions.controls { gap: 10px; }
  #ant-table th,
  #ant-table td { padding: 8px 10px; }
}

/* Breakpoint: mobile landscape and small tablets */
@media (max-width: 768px) {
  .actions.controls > div { flex: 1 1 calc(50% - 12px); min-width: 200px; }
  .actions.controls button { flex: 0 0 auto; }
  #ant-table th,
  #ant-table td { font-size: 13px; }
}

/* Breakpoint: mobile portrait */
@media (max-width: 480px) {
  .actions.controls { gap: 12px; }
  .actions.controls > div { flex: 1 1 100%; min-width: 0; }
  .actions.controls input,
  .actions.controls select { width: 100%; }
  #ant-table th,
  #ant-table td { font-size: 12px; }
  /* Make action links wrap nicely on narrow screens */
  #ant-table td.actions { white-space: normal; }
}

/* Payments Table */
#payments-table table {
  width: 100%;
  border-collapse: collapse;
}

#payments-table th, 
#payments-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

#payments-table th {
  font-weight: 600;
  background-color: #f9fafb;
}

#payments-table tr:hover {
  background-color: #f8f9fa;
}

/* Responsive enhancements (non-breaking) */
img, video {
  max-width: 100%;
  height: auto;
}

.nav { flex-wrap: wrap; }
.actions { flex-wrap: wrap; }

.card {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-wrap table { border-collapse: collapse; }

.btn--small {
  padding: 4px 8px;
  font-size: 12px;
}
