/* ===========================
   DESIGN SYSTEM
   =========================== */
:root {
  /* Colors */
  --red-primary: #DC2626;
  --red-dark: #991B1B;
  --red-light: #FEE2E2;
  --red-glow: rgba(220, 38, 38, 0.3);

  --bg-body: #0F1117;
  --bg-card: #1A1D27;
  --bg-card-hover: #22263300;
  --bg-input: #252A36;
  --bg-surface: #2A2F3D;

  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --green-available: #22C55E;
  --green-glow: rgba(34, 197, 94, 0.25);
  --green-dark: #166534;

  --amber-warn: #F59E0B;
  --blue-info: #3B82F6;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(220, 38, 38, 0.5);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --shadow-md: 0 8px 30px rgba(0,0,0,0.3);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 40px var(--red-glow);

  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s ease;
}

/* ===========================
   RESET & BASE
   =========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(220, 38, 38, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(220, 38, 38, 0.06), transparent);
  pointer-events: none;
  z-index: 0;
}

/* ===========================
   HEADER
   =========================== */
.header {
  position: relative;
  background: linear-gradient(135deg, #1A1D27 0%, #252A36 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 0;
  overflow: hidden;
}

.header-glow {
  position: absolute;
  top: -60%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(220, 38, 38, 0.2), transparent 70%);
  pointer-events: none;
}

.header-content {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

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

.cross-icon {
  font-size: 36px;
  color: var(--red-primary);
  filter: drop-shadow(0 0 12px var(--red-glow));
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 12px var(--red-glow)); }
  50% { filter: drop-shadow(0 0 24px rgba(220, 38, 38, 0.5)); }
}

.header-text h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, #e2e8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 2px;
}

.header-dates {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.date-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: #FCA5A5;
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
}

.date-icon {
  font-size: 0.9rem;
}

/* ===========================
   MAIN CONTAINER
   =========================== */
.main-container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

/* ===========================
   STEP INDICATOR
   =========================== */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 32px;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.4;
  transition: var(--transition);
}

.step.active {
  opacity: 1;
}

.step.completed {
  opacity: 0.8;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  transition: var(--transition);
}

.step.active .step-circle {
  background: var(--red-primary);
  border-color: var(--red-primary);
  box-shadow: 0 0 20px var(--red-glow);
}

.step.completed .step-circle {
  background: var(--green-available);
  border-color: var(--green-available);
}

.step span {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.step.active span {
  color: var(--text-primary);
}

.step-line {
  width: 60px;
  height: 2px;
  background: var(--border-color);
  margin: 0 12px;
}

/* ===========================
   CARDS
   =========================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
  animation: fadeSlideUp 0.5s ease forwards;
}

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

.card-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-icon {
  font-size: 1.3rem;
}

.card-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

/* ===========================
   DAY TABS
   =========================== */
.day-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

.day-tab {
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-primary);
  font-family: inherit;
}

.day-tab:hover {
  border-color: rgba(220, 38, 38, 0.3);
  background: rgba(220, 38, 38, 0.05);
}

.day-tab.active {
  border-color: var(--red-primary);
  background: rgba(220, 38, 38, 0.08);
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.15);
}

.day-name {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  font-weight: 600;
}

.day-number {
  font-size: 1.1rem;
  font-weight: 700;
}

.slots-count {
  font-size: 0.75rem;
  color: var(--green-available);
  font-weight: 500;
  margin-top: 2px;
}

/* ===========================
   PERIOD SECTIONS & SLOTS
   =========================== */
.period-section {
  margin-bottom: 24px;
}

.period-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.period-title small {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.82rem;
}

.period-icon {
  font-size: 1.1rem;
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}

.slot-btn {
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  border: 1.5px solid;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

/* Available slot */
.slot-btn.available {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.3);
  color: var(--green-available);
}

.slot-btn.available:hover {
  background: rgba(34, 197, 94, 0.15);
  border-color: var(--green-available);
  box-shadow: 0 0 16px var(--green-glow);
  transform: translateY(-2px);
}

.slot-btn.available.selected {
  background: var(--green-available);
  border-color: var(--green-available);
  color: #fff;
  box-shadow: 0 0 24px var(--green-glow);
  transform: translateY(-2px);
}

/* Booked slot */
.slot-btn.booked {
  background: rgba(100, 116, 139, 0.08);
  border-color: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.5;
}

.slot-btn.booked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 1.5px;
  background: var(--text-muted);
  opacity: 0.5;
}

/* ===========================
   SELECTED SLOT INFO
   =========================== */
.selected-slot-info {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--green-available);
  animation: fadeSlideUp 0.3s ease;
}

.check-icon {
  font-size: 1.2rem;
  font-weight: 800;
}

/* ===========================
   BUTTONS
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--red-primary), #B91C1C);
  color: #fff;
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.3);
  width: 100%;
  margin-top: 8px;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(220, 38, 38, 0.4);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

.btn-arrow {
  font-size: 1.1rem;
  transition: transform 0.2s ease;
}

.btn:hover .btn-arrow {
  transform: translateX(3px);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.form-actions .btn-secondary {
  flex: 0 0 auto;
}

.form-actions .btn-primary {
  flex: 1;
  margin-top: 0;
}

/* ===========================
   FORM
   =========================== */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}

.form-group input:focus {
  border-color: var(--red-primary);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

/* ===========================
   CONSENT BOX
   =========================== */
.consent-box {
  margin: 24px 0 8px;
  padding: 20px;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: var(--radius-md);
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  position: relative;
}

.consent-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.consent-check {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  margin-top: 2px;
}

.consent-check::after {
  content: '✓';
  font-size: 14px;
  color: #fff;
  opacity: 0;
  transform: scale(0);
  transition: var(--transition);
}

.consent-label input:checked + .consent-check {
  background: var(--red-primary);
  border-color: var(--red-primary);
  box-shadow: 0 0 12px var(--red-glow);
}

.consent-label input:checked + .consent-check::after {
  opacity: 1;
  transform: scale(1);
}

.consent-text {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ===========================
   SUCCESS / STEP 3
   =========================== */
.success-animation {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.success-circle {
  width: 80px;
  height: 80px;
}

.checkmark {
  width: 80px;
  height: 80px;
  border-radius: 50%;
}

.checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke-miterlimit: 10;
  stroke: var(--green-available);
  fill: none;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke: var(--green-available);
  stroke-width: 3;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
  100% { stroke-dashoffset: 0; }
}

.success-title {
  text-align: center;
  justify-content: center;
  color: var(--green-available);
}

.confirmation-details {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 20px 0;
}

.confirmation-details .detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.confirmation-details .detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.detail-value {
  color: var(--text-primary);
  font-weight: 600;
}

.confirmation-note {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 16px 0 24px;
}

/* ===========================
   CLOSED CARD
   =========================== */
.closed-card {
  text-align: center;
  padding: 60px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.closed-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.closed-card h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.closed-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ===========================
   LOADING OVERLAY
   =========================== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 17, 23, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 1000;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border-color);
  border-top-color: var(--red-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-overlay p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ===========================
   TOAST
   =========================== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 90%;
  text-align: center;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  border-color: rgba(220, 38, 38, 0.4);
  color: #FCA5A5;
}

.toast.success {
  border-color: rgba(34, 197, 94, 0.4);
  color: var(--green-available);
}

/* ===========================
   FOOTER
   =========================== */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 32px 20px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.footer-small {
  margin-top: 4px;
  font-size: 0.75rem;
  opacity: 0.7;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 640px) {
  .header-content {
    flex-direction: column;
    text-align: center;
  }

  .header-logo {
    flex-direction: column;
    gap: 10px;
  }

  .header-text h1 {
    font-size: 1.3rem;
  }

  .header-dates {
    justify-content: center;
  }

  .card {
    padding: 24px 18px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .slots-grid {
    grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  }

  .step span {
    display: none;
  }

  .step-line {
    width: 30px;
  }

  .form-actions {
    flex-direction: column-reverse;
  }
}

/* ===========================
   ADMIN PAGE STYLES
   =========================== */
.admin-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px;
  position: relative;
  z-index: 1;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.admin-header h1 {
  font-size: 1.5rem;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--red-primary);
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin-top: 4px;
}

.admin-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-table th {
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

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

.admin-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.export-btn {
  background: var(--green-available);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.export-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
