/* ============================================
   FORM-COMMON.CSS - Shared styles for form pages
   ============================================ */

:root {
  --primary: #134633; /* Forest Green */
  --primary-light: #247A5B;
  --primary-dark: #0C2E21;
  --secondary: #247A5B;
  --secondary-light: #3B9D75;
  --detail-gold: #CF9626;
  --gold-soft: rgba(207, 150, 38, 0.12);
  --gold-border: rgba(207, 150, 38, 0.32);
  --gold-glow: rgba(207, 150, 38, 0.22);
  --accent: #134633;
  --accent-green: #10b981;
  --bg-base: #FAFBFA;
  --bg-card: rgba(255,255,255,0.95);
  --bg-card-hover: #FFFFFF;
  --border: rgba(19, 70, 51, 0.1);
  --border-hover: rgba(19, 70, 51, 0.25);
  --text-primary: #14241D;
  --text-secondary: #364A40;
  --text-muted: #6B8075;
  --glass: rgba(255, 255, 255, 0.95);
  --glass-modal: rgba(255, 255, 255, 0.98);
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background-color: var(--bg-base);
  background-image: none;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-user-select: none;
  user-select: none;
}
input, textarea {
  -webkit-user-select: auto;
  user-select: auto;
}
::selection { background: rgba(19, 70, 51, 0.2); color: var(--text-primary); }

/* Background */
.bg-canvas {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: transparent;
}

/* ''' TOPBAR ''' */
.form-topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem; height: 64px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.back-link {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--text-secondary); text-decoration: none;
  font-size: 0.85rem; font-weight: 500;
  padding: 0.45rem 1rem; border-radius: 50px;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.back-link:hover {
  color: var(--text-primary);
  background: var(--bg-card);
  border-color: var(--border-hover);
}
.topbar-brand {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: 1.2rem;
  font-weight: 800; color: var(--primary);
  position: relative; z-index: 999; pointer-events: auto; cursor: pointer;
}
.accent { color: var(--primary-light); }
.accent-cyan { color: var(--secondary); }
.topbar-step-label {
  font-size: 0.8rem; font-weight: 600;
  color: var(--primary);
  background: rgba(19, 70, 51, 0.1);
  border: 1px solid rgba(19, 70, 51, 0.2);
  padding: 0.35rem 0.9rem; border-radius: 50px;
}
.student-step-label {
  color: var(--primary);
  background: rgba(19,70,51,0.1);
  border-color: rgba(19,70,51,0.25);
}

/* ''' PAGE LAYOUT ''' */
.form-page-layout {
  position: relative; z-index: 1;
  display: flex; min-height: calc(100vh - 64px);
}

/* ''' SIDEBAR ''' */
.form-sidebar {
  width: 320px; flex-shrink: 0;
  position: sticky; top: 64px; height: calc(100vh - 64px);
  overflow-y: auto; overflow-x: hidden;
  border-right: 1px solid var(--border);
  padding: 2.5rem 2rem;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
}
.sidebar-inner { display: flex; flex-direction: column; gap: 1.75rem; }
.sidebar-hero-icon {
  width: 72px; height: 72px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-title {
  font-family: var(--font-display); font-size: 2rem;
  font-weight: 900; line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--primary);
}
.sidebar-desc {
  color: var(--text-secondary); font-size: 0.875rem;
  line-height: 1.75;
}

/* Sidebar Steps */
.sidebar-steps { display: flex; flex-direction: column; gap: 0; }
.ss-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  transition: var(--transition); opacity: 0.5;
  cursor: default;
}
.ss-item.active { opacity: 1; background: var(--bg-base); }
.ss-item.done { opacity: 0.8; }
.ss-num {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
  background: var(--bg-card);
  border: 1.5px solid var(--border-hover);
  color: var(--text-muted);
  transition: var(--transition);
}
.ss-item.active .ss-num {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: var(--primary); color: #fff;
  box-shadow: 0 0 18px rgba(19, 70, 51, 0.2);
}
.ss-item.done .ss-num {
  background: var(--accent-green); border-color: var(--accent-green); color: #fff;
}
}

/* ''' PAGE LAYOUT ''' */
.form-page-layout {
  position: relative; z-index: 1;
  display: flex; min-height: calc(100vh - 64px);
}

/* ''' SIDEBAR ''' */
.form-sidebar {
  width: 320px; flex-shrink: 0;
  position: sticky; top: 64px; height: calc(100vh - 64px);
  overflow-y: auto; overflow-x: hidden;
  border-right: 1px solid var(--border);
  padding: 2.5rem 2rem;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
}
.sidebar-inner { display: flex; flex-direction: column; gap: 1.75rem; }
.sidebar-hero-icon {
  width: 72px; height: 72px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-title {
  font-family: var(--font-display); font-size: 2rem;
  font-weight: 900; line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--primary);
}
.sidebar-desc {
  color: var(--text-secondary); font-size: 0.875rem;
  line-height: 1.75;
}

/* Sidebar Steps */
.sidebar-steps { display: flex; flex-direction: column; gap: 0; }
.ss-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  transition: var(--transition); opacity: 0.5;
  cursor: default;
}
.ss-item.active { opacity: 1; background: var(--bg-base); }
.ss-item.done { opacity: 0.8; }
.ss-num {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
  background: var(--bg-card);
  border: 1.5px solid var(--border-hover);
  color: var(--text-muted);
  transition: var(--transition);
}
.ss-item.active .ss-num {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: var(--primary); color: #fff;
  box-shadow: 0 0 18px rgba(19, 70, 51, 0.2);
}
.ss-item.done .ss-num {
  background: var(--accent-green); border-color: var(--accent-green); color: #fff;
}
/* Force standard font for numbers to prevent stylization issues */
.ss-num, .student-ss-num, .step-num-badge, .student-badge-label, .rc-icon {
  font-family: 'Inter', sans-serif !important;
}
.student-ss-num {}
.ss-item.active .student-ss-num {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 18px rgba(19,70,51,0.35);
  color: #fff;
}
.ss-name { font-weight: 600; font-size: 0.88rem; color: var(--text-primary); }
.ss-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.ss-connector {
  width: 1.5px; height: 20px; margin-left: 24px;
  background: var(--border);
}

/* Sidebar Badges */
.sidebar-badges { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }
.sb-badge {
  font-size: 0.75rem; font-weight: 600; padding: 0.45rem 0.8rem;
  border-radius: 50px; border: 1px solid rgba(19, 70, 51, 0.2);
  background: rgba(19, 70, 51, 0.05); color: var(--text-secondary);
  display: inline-flex; align-items: center; gap: 6px;
}
.student-badge {
  border-color: rgba(19,70,51,0.2); background: rgba(19,70,51,0.08);
}

/* ''' FORM PANEL ''' */
.form-panel {
  flex: 1; overflow-y: auto;
  padding: 2.5rem 3rem;
  max-width: 860px;
}
.form-panel-inner { max-width: 780px; }

/* Page Progress Bar */
.page-progress-bar-wrap {
  height: 4px; background: rgba(19, 70, 51, 0.1);
  border-radius: 4px; margin-bottom: 2.5rem; overflow: hidden;
}
.page-progress-bar {
  height: 100%; border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.teacher-progress { background: linear-gradient(90deg, var(--primary), var(--detail-gold)); }
.student-progress { background: linear-gradient(90deg, var(--detail-gold), var(--primary-light)); }

/* ''' STEP ''' */
.form-step { display: none; }
.form-step.active {
  display: block;
  animation: stepSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes stepSlideIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

.step-header { margin-bottom: 2rem; }
.step-num-badge {
  display: inline-block; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.3rem 0.9rem; border-radius: 50px;
  margin-bottom: 0.75rem;
}
.teacher-badge {
  background: rgba(19,70,51,0.1); color: var(--primary);
  border: 1px solid rgba(19,70,51,0.25);
}
.student-badge-label {
  background: var(--gold-soft); color: var(--detail-gold);
  border: 1px solid rgba(200,148,26,0.28);
}
.step-title {
  font-family: var(--font-display); font-size: 1.9rem;
  font-weight: 800; letter-spacing: -0.025em;
  color: var(--text-primary); margin-bottom: 0.5rem;
}
.step-intro { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.7; }

/* ''' FIELDS ''' */
.fields-grid { display: grid; gap: 1.25rem; margin-bottom: 1.5rem; }
.fields-grid.two-col { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .fields-grid.two-col { grid-template-columns: 1fr; } }
.full-width { margin-bottom: 1.5rem; }

.field-group { display: flex; flex-direction: column; gap: 0.5rem; }
.field-label {
  font-size: 0.8rem; font-weight: 600;
  color: var(--text-secondary); letter-spacing: 0.04em;
  text-transform: uppercase;
}
.optional { font-size: 0.72rem; text-transform: none; font-weight: 400; color: var(--text-muted); }
.req { color: #f87171; }

.field-wrap {
  position: relative; display: flex; align-items: center;
}
.field-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none; display: flex;
  font-size: 0.9rem;
  transition: color var(--transition);
}
.currency-icon {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}
.field-input {
  width: 100%;
  padding: 0.95rem 1rem 0.95rem 2.75rem;
  background: rgba(19,70,51,0.02);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 0.95rem;
  font-family: var(--font-body); outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  line-height: 1.5;
}
/* Real-time Validation for Phone */
input[type="tel"]:not(:placeholder-shown):valid {
  border-color: var(--accent-green) !important;
}
input[type="tel"]:not(:placeholder-shown):invalid {
  border-color: #ef4444 !important;
}
.field-input::placeholder { color: var(--text-muted); font-size: 0.88rem; }
.field-input:focus {
  border-color: rgba(19,70,51,0.6);
  background: rgba(19,70,51,0.04);
  box-shadow: 0 0 0 3px rgba(19,70,51,0.15);
}
.field-input:focus ~ .field-icon,
.field-wrap:focus-within .field-icon { color: var(--primary-light); }
.student-theme .field-input:focus {
  border-color: rgba(200,148,26,0.6);
  box-shadow: 0 0 0 3px rgba(200,148,26,0.15);
}
.student-theme .field-wrap:focus-within .field-icon { color: var(--detail-gold); }
  border-radius: var(--radius-md);
}
.ss-label {
  font-size: 0.78rem; font-weight: 700; color: var(--accent-green);
  margin-bottom: 0.6rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.ss-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ss-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.78rem; font-weight: 600;
  padding: 0.3rem 0.75rem; border-radius: 50px;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.25);
  color: var(--accent-green);
}

/* ''' REVIEW BOX ''' */
.review-box {
  margin: 1.5rem 0;
  background: rgba(6, 10, 30, 0.6);
  border: 1.5px solid rgba(19,70,51,0.4);
  border-radius: var(--radius-lg);
  padding: 0;
  display: none;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(19,70,51,0.2), 0 0 0 1px rgba(19,70,51,0.02) inset;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.review-box.show {
  display: block;
  animation: fadeUp 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.student-theme .review-box {
  border-color: rgba(200,148,26,0.3);
}

/* Live pulse border when slot is being added */
.review-box.pulse-update {
  border-color: rgba(16,185,129,0.5);
  box-shadow: 0 8px 32px rgba(19,70,51,0.2), 0 0 20px rgba(16,185,129,0.12);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Review header */
.rb-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-base);
}
.rb-title {
  font-family: var(--font-display);
  font-weight: 700; font-size: 0.95rem;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.rb-live-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.3);
  color: var(--accent-green);
  padding: 0.2rem 0.6rem; border-radius: 50px;
}
.rb-live-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent-green);
  animation: livePulse 1.4s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(1.6); }
}
.rb-hint {
  font-size: 0.72rem; color: var(--text-muted);
  font-style: italic;
}

/* Review grid */
.rb-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0; padding: 0.5rem 0;
}
.rb-item {
  padding: 0.7rem 1.5rem;
  border-radius: 0;
  transition: background 0.25s ease;
  position: relative; overflow: hidden;
}
.rb-item::before {
  content: '';
  position: absolute; inset: 0;
  background: rgba(16,185,129,0.08);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0s;
  border-radius: 0;
}

/* Flash animation when value updates */
.rb-item.flash::before {
  transform: scaleX(1);
  transition: transform 0.05s ease;
  animation: rbFlash 0.6s ease forwards;
}
@keyframes rbFlash {
  0%   { opacity: 1; }
  60%  { opacity: 0.4; }
  100% { opacity: 0; }
}

.rb-key {
  font-size: 0.72rem; font-weight: 700;
  color: var(--text-muted); letter-spacing: 0.04em;
  text-transform: uppercase; margin-bottom: 3px;
}
.rb-val {
  font-size: 0.88rem; font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.5;
  transition: color 0.3s ease;
  word-break: break-word;
}
.rb-val.has-value { color: var(--text-primary); }
.rb-val.empty     { color: var(--text-muted); font-style: italic; }
/* Slots value gets accent colour */
.rb-val.slots-val { color: var(--accent-green); }
.student-theme .rb-val.slots-val { color: var(--detail-gold); }

.rb-item.full-width {
  grid-column: span 2;
}

/* Divider between rows */
.rb-item:not(.full-width):nth-child(odd) {
  border-right: 1px solid rgba(19,70,51,0.02);
}
.rb-item:nth-child(n+3) {
  border-top: 1px solid rgba(19,70,51,0.02);
}

/* ''' STEP ACTIONS ''' */
.step-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-top: 2rem; flex-wrap: wrap;
}
.action-hint {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.78rem; color: var(--text-muted);
  flex: 1;
}
.btn-page-next {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0.9rem 2rem; border: none; border-radius: 50px;
  font-size: 0.9rem; font-weight: 700; cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, background 0.3s ease, border-color 0.3s ease;
  white-space: nowrap;
}
.btn-page-next:active, .btn-page-back:active, .btn-submit-final:active, .submit-btn-glow:active {
  transform: scale(0.96) !important;
}
.teacher-next-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 8px 28px rgba(124,58,237,0.35);
}
.teacher-next-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(124,58,237,0.5); }
.student-next-btn {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: #fff;
  box-shadow: 0 8px 28px rgba(19,70,51,0.35);
}
.student-next-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(19,70,51,0.48); }
.btn-page-back {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0.85rem 1.5rem; border-radius: 50px;
  background: var(--border); border: 1.5px solid var(--border);
  color: var(--text-secondary); font-size: 0.88rem; font-weight: 600;
  cursor: pointer; transition: var(--transition);
}
.btn-page-back:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.btn-submit-page {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0.95rem 2.25rem; border: none; border-radius: 50px;
  font-size: 0.95rem; font-weight: 700; cursor: pointer;
  transition: var(--transition-spring);
  position: relative; overflow: hidden;
  white-space: nowrap;
}
.teacher-submit-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; box-shadow: 0 10px 32px rgba(19,70,51,0.8);
}
.teacher-submit-btn:hover { transform: translateY(-3px); box-shadow: 0 18px 42px rgba(124,58,237,0.55); }
.student-submit-btn {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: #fff; box-shadow: 0 10px 32px rgba(6,182,212,0.38);
}
.student-submit-btn:hover { transform: translateY(-3px); box-shadow: 0 18px 42px rgba(6,182,212,0.52); }
.btn-submit-page::before {
  content: ''; position: absolute;
  top: -50%; left: -100%; width: 60%; height: 200%;
  background: rgba(255,255,255,0.15); transform: skewX(-20deg);
  transition: left 0.5s ease;
}
.btn-submit-page:hover::before { left: 140%; }

/* Custom subject */
.custom-subj-section { margin: 1.25rem 0; }
.custom-subj-trigger {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0.65rem 1.25rem;
  border: 1.5px dashed rgba(245,158,11,0.4);
  border-radius: 50px; cursor: pointer;
  color: var(--accent); font-size: 0.85rem; font-weight: 600;
  transition: var(--transition);
}
.custom-subj-trigger:hover { border-color: var(--accent); background: rgba(245,158,11,0.07); }
.cst-icon { font-size: 1rem; }
.cst-badge {
  font-size: 0.72rem; color: var(--text-muted); font-weight: 400;
}
.custom-input-area {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  padding: 0 4px;
}
.custom-input-area.open { max-height: 160px; opacity: 1; }
.btn-add-custom {
  margin-top: 0.75rem;
  padding: 0.55rem 1.25rem;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.35);
  color: var(--accent); border-radius: 50px;
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: var(--transition);
}
.btn-add-custom:hover { background: rgba(245,158,11,0.18); border-color: var(--accent); }

/* ''' SUCCESS OVERLAY ''' */
.success-page-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(20px);
  display: flex; flex-direction: column; align-items: center;
  padding: 2rem 1.5rem;
  overflow-y: auto;
  opacity: 0; visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.success-page-overlay::before,
.success-page-overlay::after {
  content: "";
  flex: 1 1 0px;
}
.success-page-overlay.open { opacity: 1; visibility: visible; }
.success-page-card {
  flex-shrink: 0;
  margin: 0 auto;
  max-width: 520px; width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 28px; padding: 3rem 2.5rem;
  text-align: center; position: relative; overflow: hidden;
  transform: scale(0.85);
  transition: transform 0.5s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 0 100px rgba(19,70,51,0.4);
}
.student-success-card { border-color: var(--border); box-shadow: 0 0 100px rgba(19,70,51,0.25); }
.success-page-overlay.open .success-page-card { transform: scale(1); }
.spc-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.spc-icon-wrap {
  position: relative; width: 96px; height: 96px;
  margin: 0 auto 1.75rem;
  display: flex; align-items: center; justify-content: center;
}
.spc-ring {
  position: absolute; border-radius: 50%; border: 2px solid;
  animation: spcRing 0.8s ease both;
}
.r1 { inset:0; border-color: rgba(19,70,51,0.8); animation-delay: 0.2s; }
.r2 { inset:-14px; border-color: rgba(19,70,51,0.4); animation-delay: 0.4s; }
.student-r1 { border-color: rgba(200,148,26,0.8); }
.student-r2 { border-color: rgba(200,148,26,0.3); }
@keyframes spcRing { from{transform:scale(0.4);opacity:0;} to{transform:scale(1);opacity:1;} }
.spc-check {
  width: 76px; height: 76px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  animation: spcCheck 0.5s cubic-bezier(0.34,1.56,0.64,1) 0.35s both;
  box-shadow: 0 0 40px rgba(19,70,51,0.8);
}
.student-check { box-shadow: 0 0 40px rgba(6,182,212,0.35); }
@keyframes spcCheck { from{transform:scale(0);opacity:0;} to{transform:scale(1);opacity:1;} }
.spc-title {
  font-family: var(--font-display); font-size: 1.8rem; font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 0.75rem;
}
.spc-msg { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.75; }
.spc-summary {
  margin: 1.25rem 0;
  background: rgba(19,70,51,0.1);
  border: 1px solid rgba(19,70,51,0.35); border-radius: var(--radius-md);
  padding: 1rem 1.25rem; text-align: left;
  font-size: 0.85rem; color: var(--text-primary); line-height: 2;
}
.btn-spc-home {
  display: inline-flex; align-items: center; gap: 9px;
  margin-top: 1.5rem; padding: 0.9rem 2rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; text-decoration: none;
  border-radius: 50px; font-size: 0.9rem; font-weight: 700;
  transition: var(--transition-spring);
  box-shadow: 0 8px 28px rgba(124,58,237,0.35);
}
.btn-spc-home:hover { transform: translateY(-2px); box-shadow: 0 15px 38px rgba(124,58,237,0.5); }
.student-home-btn {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  box-shadow: 0 8px 28px rgba(6,182,212,0.3);
}
.student-home-btn:hover { box-shadow: 0 15px 38px rgba(200,148,26,0.8); }

/* Confetti piece */
.confetti-piece {
  position: absolute; border-radius: 2px;
  animation: confFall linear forwards;
}
@keyframes confFall { from{transform:translateY(-30px)rotate(0);opacity:1;} to{transform:translateY(600px)rotate(720deg);opacity:0;} }

/* Toast */
.form-toast {
  position: fixed; bottom: 2rem; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.35);
  color: #fca5a5; padding: 0.7rem 1.6rem;
  border-radius: 50px; font-size: 0.82rem; font-weight: 600;
  backdrop-filter: blur(12px); z-index: 9999;
  opacity: 0; transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
}
.form-toast.show { opacity:1; transform: translateX(-50%) translateY(0); }

/* Shake */
@keyframes shake {
  0%,100%{transform:translateX(0);}
  20%{transform:translateX(-8px);}
  40%{transform:translateX(8px);}
  60%{transform:translateX(-5px);}
  80%{transform:translateX(5px);}
}
.shake { animation: shake 0.4s ease; }

/* ''' RESPONSIVE ''' */

/* Tablet */
@media (max-width: 900px) {
  .form-sidebar { display: none; }
  .form-panel { padding: 2rem 1.75rem; }
  .fields-grid.two-col { grid-template-columns: 1fr; }
}

/* Mobile */
@media (max-width: 640px) {
  /* Topbar */
  .form-topbar { 
    padding: 0 1rem; 
    justify-content: space-between;
  }
  .topbar-brand {
    font-size: 1.1rem;
    white-space: nowrap;
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar-step-label { 
    font-size: 0.72rem; 
    padding: 0.3rem 0.7rem; 
    white-space: nowrap !important; 
    min-width: fit-content;
    flex-shrink: 0;
  }

  /* Form Panel */
  .form-panel { padding: 1.5rem 1rem 3rem; }
  .form-panel-inner { max-width: 100%; }

  /* Step Header */
  .step-title { font-size: 1.55rem; }

  /* Timeslot Grid - 2 columns on mobile */
  .timeslot-full-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }
  .time-card { padding: 0.85rem 0.5rem; }
  .tc-emoji { font-size: 1.3rem; }
  .tc-time { font-size: 0.8rem; }
  .tc-period { font-size: 0.65rem; }

  /* Step actions */
  .step-actions {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 0.7rem;
  }
  .action-hint { justify-content: center; font-size: 0.75rem; }
  .btn-page-next, .btn-page-back, .btn-submit-page {
    width: 100%; justify-content: center;
    padding: 0.95rem 1.5rem;
    font-size: 0.9rem;
  }

  .profile-photo-picker {
    align-items: flex-start;
    gap: 0.85rem;
  }
  .profile-photo-preview {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
  }

  /* Success card */
  .success-page-card { padding: 2.5rem 1.5rem; }
  .spc-title { font-size: 1.5rem; }
  .btn-spc-home { width: 100%; justify-content: center; }

  /* Review Box */
  .rb-grid { grid-template-columns: 1fr; }
  .rb-item.full-width { grid-column: span 1; }
  .rb-item:not(.full-width):nth-child(odd) { border-right: none; }
  .rb-item:nth-child(n+2) { border-top: 1px solid rgba(19,70,51,0.02); }

  /* Toast - wider on mobile */
  .form-toast { bottom: 1.25rem; left: 1rem; right: 1rem; transform: translateY(20px); width: auto; }
  .form-toast.show { transform: translateY(0); }
}

/* Very small screens */
@media (max-width: 390px) {
  .form-panel { padding: 1.25rem 0.875rem 3rem; }
  .step-title { font-size: 1.35rem; }
  .timeslot-full-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .time-card { padding: 0.7rem 0.4rem; }
  .tc-emoji { font-size: 1.1rem; }
  .tc-time { font-size: 0.75rem; }
}

/* Floating Animation for Subjects */
@keyframes floatSubtle {
  0% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}

.subject-chip, .custom-subj-trigger {
  animation: floatSubtle 4s ease-in-out infinite alternate;
}
.subject-chip:nth-child(even) { animation-delay: 1.2s; }
.subject-chip:nth-child(3n) { animation-delay: 2.1s; }

/* Disable animation on hover to prevent transform conflicts */
.subject-chip:hover, .subject-chip.selected, .custom-subj-trigger:hover {
  animation: none;
}










/* ============================================================
   CALL-NOW MODAL  (used on demo.html step 5)
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}
.modal-box {
  background: var(--glass-modal, #fff);
  border-radius: 20px;
  padding: 2rem 2rem 1.75rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.28);
  animation: slideUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.sc-icon {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; margin: 0 auto 1rem;
}
.sc-title {
  font-family: var(--font-display);
  font-size: 1.35rem; font-weight: 700;
  color: var(--text-primary); margin-bottom: 0.6rem;
}
.sc-desc {
  font-size: 0.92rem; color: var(--text-secondary);
  line-height: 1.55; margin-bottom: 1.5rem;
}
.btn-sc-continue {
  display: block; width: 100%;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; font-family: var(--font-display);
  font-size: 1rem; font-weight: 600;
  border: none; border-radius: 12px; cursor: pointer;
  text-decoration: none; margin-bottom: 0.6rem;
  transition: opacity 0.2s, transform 0.2s;
}
.btn-sc-continue:hover { opacity: 0.92; transform: translateY(-1px); }
.btn-sc-cancel {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary); font-size: 0.92rem;
  padding: 0.6rem 1.5rem; border-radius: 10px;
  cursor: pointer; width: 100%; transition: background 0.2s;
}
.btn-sc-cancel:hover { background: rgba(19,70,51,0.06); }
@keyframes slideUp {
  from { transform: translateY(30px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* Student theme chips - GREEN (overrides gold) */
.student-theme .subject-chip:hover {
  border-color: rgba(19,70,51,0.6);
  background: rgba(19,70,51,0.1);
  color: var(--primary);
}
.student-theme .subject-chip.selected {
  border-color: var(--primary);
  background: rgba(19,70,51,0.15);
  color: var(--primary);
  box-shadow: 0 4px 16px rgba(19,70,51,0.25);
}


.chips-grid { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.5rem; }


/* Timeslot cards */
.time-card:hover {
  border-color: rgba(19,70,51,0.8); background: rgba(19,70,51,0.1);
  transform: translateY(-3px); box-shadow: 0 6px 20px rgba(19,70,51,0.2);
}
.time-card.selected {
  border-color: var(--primary); background: rgba(19,70,51,0.15);
  box-shadow: 0 6px 20px rgba(19,70,51,0.4); transform: translateY(-3px);
}


/* Student timeslot - GREEN */
.student-tc:hover {
  border-color: rgba(19,70,51,0.5); background: rgba(19,70,51,0.06);
  box-shadow: 0 6px 20px rgba(19,70,51,0.12);
}
.student-tc.selected {
  border-color: var(--primary); background: rgba(19,70,51,0.15);
  box-shadow: 0 6px 20px rgba(19,70,51,0.25);
}


/* Selected Summary Box */
.selected-summary {
  margin: 1rem 0;
  padding: 1rem 1.25rem;
  background: rgba(19,70,51,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.ss-label {
  font-size: 0.78rem; font-weight: 700; color: var(--accent-green);
  margin-bottom: 0.6rem; text-transform: uppercase; letter-spacing: 0.05em;
}

/* ===== FREQUENCY OF CLASSES CARDS ===== */
.freq-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.18s;
  background: var(--white);
  text-align: center;
  gap: 0.3rem;
}
.freq-card:hover {
  border-color: var(--primary);
  background: rgba(19,70,51,0.04);
  transform: translateY(-2px);
}
.student-theme .freq-card.selected {
  border-color: var(--primary);
  background: rgba(19,70,51,0.08);
  box-shadow: 0 0 0 3px rgba(19,70,51,0.12);
}
.freq-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.freq-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.freq-sub {
  font-size: 0.73rem;
  color: var(--text-muted);
}
@media (max-width: 600px) {
  .freq-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Timeslot Full Grid Base */
.timeslot-full-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-top: 1rem;
}

/* =========================================
   BASE STYLES FOR CHIPS AND CARDS (RESTORED)
   ========================================= */

/* Subject Chips */
.subject-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid var(--border); border-radius: 50px;
  font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: var(--transition-spring);
  color: var(--text-secondary); user-select: none;
}
.subject-chip:hover {
  border-color: rgba(245,158,11,0.4);
  color: var(--accent);
  background: rgba(245,158,11,0.1);
  transform: translateY(-2px);
}
.subject-chip.selected {
  border-color: var(--accent);
  background: rgba(245,158,11,0.15);
  color: var(--accent);
}
.ci { font-size: 1rem; }

/* Time Cards */
.time-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1rem; text-align: center;
  border: 1.5px solid var(--border); border-radius: 12px;
  background: rgba(255,255,255,0.02); cursor: pointer;
  transition: var(--transition-spring); user-select: none;
}
.tc-emoji { font-size: 1.5rem; margin-bottom: 0.5rem; }
.tc-time { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.tc-dash { font-size: 0.8rem; color: var(--text-muted); margin: 2px 0; }
.tc-period { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.4rem; font-weight: 500; }

/* Guarantee Student Theme Green Colors */
.student-theme .subject-chip:hover {
  border-color: rgba(19,70,51,0.6) !important;
  background: rgba(19,70,51,0.1) !important;
  color: var(--primary) !important;
}
.student-theme .subject-chip.selected {
  border-color: var(--primary) !important;
  background: rgba(19,70,51,0.15) !important;
  color: var(--primary) !important;
}
.student-theme .time-card:hover, .student-theme .student-tc:hover {
  border-color: rgba(19,70,51,0.6) !important;
  background: rgba(19,70,51,0.1) !important;
}
.student-theme .time-card.selected, .student-theme .student-tc.selected {
  border-color: var(--primary) !important;
  background: rgba(19,70,51,0.15) !important;
}
.student-theme .qchip.active {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary) !important;
}
.student-theme .radio-card.selected {
  border-color: var(--primary) !important;
  background: rgba(19,70,51,0.1) !important;
}
