/* ============================================================
   SISO Public Design System — Modern, Mobile-First
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #0f766e;
  --primary-hover: #0d6560;
  --primary-light: #ccfbf1;
  --primary-50: #f0fdfa;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;

  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --bg: #f1f5f9;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);

  --transition: 0.2s ease;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   AUTH PAGES (Login / Register / Forgot Password)
   ============================================================ */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f766e 0%, #134e4a 50%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-container {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.auth-header {
  background: linear-gradient(135deg, #0f766e, #134e4a);
  padding: 1.5rem 1.5rem;
  text-align: center;
  color: white;
}

.auth-logo {
  width: 48px; height: 48px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  backdrop-filter: blur(4px);
}

.auth-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.auth-header p {
  font-size: 0.8125rem;
  opacity: 0.85;
}

.auth-body { padding: 1.5rem; }

.auth-form { display: grid; gap: 1rem; }

.auth-field { display: grid; gap: 0.375rem; }

.auth-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.auth-input-wrap {
  position: relative;
}

.auth-input-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.auth-input {
  width: 100%;
  padding: 0.625rem 0.875rem 0.625rem 2.5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: all var(--transition);
  outline: none;
}

.auth-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.auth-input::placeholder { color: var(--text-muted); }

.auth-input.no-icon { padding-left: 0.875rem; }

.auth-link {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: right;
  display: block;
}

.auth-link:hover { color: var(--primary); }

.auth-btn {
  width: 100%;
  padding: 0.625rem;
  background: var(--primary);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 0.25rem;
}

.auth-btn:hover { background: var(--primary-hover); box-shadow: var(--shadow-sm); }

.auth-footer {
  text-align: center;
  padding: 0.75rem 1.5rem 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.auth-footer a { font-weight: 600; color: var(--primary); }

.auth-message {
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 500;
}

.auth-message.error {
  background: var(--danger-light);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.auth-message.success {
  background: var(--success-light);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

/* ============================================================
   SISO FORM PAGE (index.php)
   ============================================================ */
.siso-page {
  background: var(--bg);
  min-height: 100vh;
}

.siso-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.siso-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.siso-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.siso-brand-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  font-weight: 800;
  flex-shrink: 0;
}

.siso-brand h1 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.siso-brand p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.siso-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.siso-user-info {
  text-align: right;
}

.siso-user-name { font-size: 0.8125rem; font-weight: 600; color: var(--text); }
.siso-user-circuit { font-size: 0.6875rem; color: var(--text-muted); }

.siso-logout {
  padding: 0.375rem 0.75rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
}

.siso-logout:hover { background: var(--danger-light); color: var(--danger); border-color: var(--danger); text-decoration: none; }

/* Stats Row */
.siso-stats {
  max-width: 1400px;
  margin: 1rem auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.siso-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.875rem 1rem;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.siso-stat h3 {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.siso-stat p {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  margin-top: 0.25rem;
}

/* Main Layout */
.siso-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}
.siso-main-form {
  max-width: 680px;
  grid-template-columns: 1fr;
  padding-top: 1rem;
}

/* Form Panel */
.siso-form-panel,
.siso-feed-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}
.panel-header:has(.wizard-header) {
  padding: 0;
  border-bottom: none;
}

.panel-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.panel-header p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}

.panel-body { padding: 1.25rem; }

/* Form Styles */
.siso-form { display: grid; gap: 1rem; }

.siso-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  background: var(--surface-alt);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.siso-fieldset legend {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--primary);
  padding: 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.siso-field {
  display: grid;
  gap: 0.25rem;
  font-size: 0.8125rem;
}

.siso-field > span:first-child,
.siso-field > label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.siso-field input,
.siso-field select,
.siso-field textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: all var(--transition);
  outline: none;
}

.siso-field input:focus,
.siso-field select:focus,
.siso-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.siso-field input[readonly] { background: var(--surface-alt); color: var(--text-secondary); }
.siso-field select[multiple] { min-height: 90px; }
.siso-field textarea { min-height: 70px; resize: vertical; }

/* Checkbox group (replaces multi-select) */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}
.checkbox-item:hover { background: var(--primary-light); }
.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  margin: 0;
}
.checkbox-item:has(input:checked) {
  background: var(--primary-light);
  font-weight: 500;
}

.siso-gps-btn {
  padding: 0.5rem 1rem;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}

.siso-gps-btn:hover { background: var(--primary); color: white; }

.siso-submit-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.3);
}

.siso-submit-btn:hover { background: var(--primary-hover); box-shadow: 0 4px 12px rgba(15, 118, 110, 0.4); }
.siso-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

#formMessage {
  min-height: 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

#formMessage.error { color: var(--danger); }
#formMessage.success { color: var(--success); }

/* Feed Panel */
.siso-feed-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.siso-feed-table thead th {
  background: var(--surface-alt);
  padding: 0.625rem 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.6875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
}

.siso-feed-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.siso-feed-table tbody { max-height: 60vh; overflow-y: auto; }
.siso-feed-table tbody tr:hover { background: var(--surface-hover, #f8fafc); }

.feed-scroll { max-height: 70vh; overflow-y: auto; }

.hidden { display: none !important; }

/* ============================================================
   SISO NAV BAR (shared between form + dashboard)
   ============================================================ */
.siso-nav {
  display: flex;
  gap: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.siso-nav-link {
  flex: 1;
  text-align: center;
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}
.siso-nav-link:hover {
  color: var(--primary);
  background: var(--primary-50);
  text-decoration: none;
}
.siso-nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--primary-50);
}

/* ============================================================
   SISO DASHBOARD
   ============================================================ */
.dash-stats {
  max-width: 900px;
  margin: 1rem auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.dash-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.dash-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.dash-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-icon-total  { background: #ede9fe; color: #7c3aed; }
.dash-icon-today  { background: #dbeafe; color: #2563eb; }
.dash-icon-lesson { background: #fef3c7; color: #d97706; }
.dash-icon-circuit{ background: #d1fae5; color: #059669; }

.dash-card-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.dash-card-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  line-height: 1.2;
}
.dash-card-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.dash-feed-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.dash-empty-feed {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.dash-empty-feed svg { margin-bottom: 0.75rem; }
.dash-empty-feed p { font-size: 0.875rem; font-weight: 500; }

/* ============================================================
   MULTI-STEP FORM WIZARD
   ============================================================ */

/* -- Step containers ---------------------------------------- */
.form-step {
  display: none;
}
.form-step.active {
  display: block;
  animation: wizardSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.form-step.slide-out-left {
  animation: wizardSlideOutLeft 0.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.form-step.slide-out-right {
  animation: wizardSlideOutRight 0.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes wizardSlideIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes wizardSlideOutLeft {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-24px); }
}
@keyframes wizardSlideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(24px); }
}

/* -- Wizard header (progress bar + step title) -------------- */
.wizard-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem 0.5rem;
}

.wizard-step-count {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  white-space: nowrap;
}

.wizard-step-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

/* Thin progress track */
.wizard-track {
  height: 3px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.wizard-track-fill {
  height: 100%;
  width: 25%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: 3px;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* -- Navigation bar ----------------------------------------- */
.wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.wizard-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 600;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.wizard-btn-back {
  padding: 0.625rem 1.5rem;
  font-size: 0.8125rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.wizard-btn-back:hover {
  background: var(--surface-alt);
  border-color: var(--text-muted);
}
.wizard-btn-back:active {
  transform: scale(0.97);
}

.wizard-btn-next {
  padding: 0.75rem 2rem;
  font-size: 0.875rem;
  background: var(--primary);
  color: var(--text-inverse);
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.25);
}
.wizard-btn-next:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.35);
  transform: translateY(-1px);
}
.wizard-btn-next:active {
  transform: translateY(0) scale(0.97);
}

.wizard-btn-submit {
  padding: 0.75rem 2rem;
  font-size: 0.875rem;
  background: linear-gradient(135deg, var(--primary), var(--success));
  color: var(--text-inverse);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}
.wizard-btn-submit:hover {
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}
.wizard-btn-submit:active {
  transform: translateY(0) scale(0.97);
}
.wizard-btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* -- Empty purpose state ------------------------------------ */
.wizard-empty {
  text-align: center;
  padding: 2.5rem 1rem;
}
.wizard-empty-icon {
  color: var(--success);
  margin-bottom: 0.75rem;
}
.wizard-empty-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.wizard-empty-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .siso-main { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .siso-header { padding: 0.75rem 1rem; }

  .siso-brand h1 { font-size: 0.875rem; }
  .siso-brand-icon { width: 32px; height: 32px; font-size: 0.875rem; }

  .siso-user-info { display: none; }

  .siso-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0 0.75rem;
    margin: 0.75rem auto;
  }

  .siso-stat { padding: 0.625rem 0.75rem; }
  .siso-stat h3 { font-size: 0.5625rem; }
  .siso-stat p { font-size: 1rem; }

  .siso-main {
    grid-template-columns: 1fr;
    padding: 0 0.75rem 1.5rem;
    gap: 0.75rem;
  }

  .panel-header { padding: 0.75rem 1rem; }
  .panel-body { padding: 0.75rem; }

  .siso-fieldset {
    grid-template-columns: 1fr;
    padding: 0.75rem;
  }

  .siso-feed-table { font-size: 0.75rem; }
  .siso-feed-table th, .siso-feed-table td { padding: 0.375rem 0.5rem; }

  /* Step wizard mobile tweaks */
  .wizard-header { padding: 0.75rem 1rem 0.375rem; }
  .wizard-step-label { font-size: 0.8125rem; }
  .wizard-btn-next, .wizard-btn-submit { padding: 0.75rem 1.75rem; }
  .wizard-nav { margin-top: 1.25rem; }

  /* Dashboard mobile */
  .dash-stats { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; padding: 0 0.75rem; }
  .dash-card { padding: 0.75rem; gap: 0.5rem; }
  .dash-card-icon { width: 36px; height: 36px; }
  .dash-card-icon svg { width: 18px; height: 18px; }
  .dash-card-value { font-size: 1.0625rem; }
  .dash-main { padding: 0 0.75rem 1.5rem; }
}

@media (max-width: 480px) {
  .siso-header-inner { flex-direction: column; align-items: stretch; gap: 0.5rem; }
  .siso-brand { justify-content: center; }
  .siso-user { justify-content: center; }
  .siso-user-info { display: block; text-align: center; }

  .wizard-header { padding: 0.625rem 0.75rem 0.375rem; }
  .wizard-step-count { font-size: 0.625rem; }
  .wizard-step-label { font-size: 0.75rem; }
  .wizard-btn-back { padding: 0.5rem 1.25rem; font-size: 0.75rem; }
  .wizard-btn-next, .wizard-btn-submit { padding: 0.625rem 1.5rem; font-size: 0.8125rem; }
  .panel-body { padding: 0.625rem; }
  .siso-fieldset { padding: 0.625rem; }

  /* Dashboard 480 */
  .dash-stats { grid-template-columns: 1fr 1fr; gap: 0.375rem; padding: 0 0.5rem; margin: 0.5rem auto; }
  .dash-card { padding: 0.625rem; border-radius: var(--radius); }
  .dash-card-icon { width: 32px; height: 32px; border-radius: var(--radius-sm); }
  .dash-card-icon svg { width: 16px; height: 16px; }
  .dash-card-label { font-size: 0.5625rem; }
  .dash-card-value { font-size: 0.9375rem; }
  .dash-main { padding: 0 0.5rem 1rem; }
}
