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

:root {
  --teal:         #1A5C47;
  --teal-mid:     #2A7A60;
  --teal-light:   #3D9B7B;
  --teal-faint:   #EAF4F0;
  --teal-faint-2: #D4EDE4;
  --teal-faint-3: #B8D9CF;
  --text:         #1A1A1A;
  --text-soft:    #4A4A4A;
  --text-muted:   #888;
  --border:       #DDE5E2;
  --white:        #FFFFFF;
  --error:        #C0392B;
  --error-bg:     #FFF5F5;
  --radius:       16px;
  --radius-sm:    10px;
  --shadow:       0 4px 32px rgba(26,92,71,0.10), 0 1px 4px rgba(0,0,0,0.05);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--teal-faint);
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   PANELS
   ============================================================ */
.panel {
  display: none;
  min-height: 100vh;
}

.panel.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 48px 16px 40px;
  min-height: 100vh;
  animation: fadeUp 0.32s ease both;
}

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

/* ============================================================
   HERO
   ============================================================ */
.panel-hero {
  background: linear-gradient(135deg, #EAF4F0, #D4EDE4, #C4E3D6, #EAF4F0);
  background-size: 400% 400%;
}

.panel-hero.active {
  animation: heroGradient 12s ease infinite, fadeUp 0.32s ease both;
  justify-content: center;
  padding: 48px 24px;
  min-height: 100vh;
}

@keyframes heroGradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-content {
  text-align: center;
  max-width: 500px;
  width: 100%;
}

.wordmark {
  font-size: 20px;
  font-weight: 700;
  color: var(--teal);
  letter-spacing: -0.2px;
  margin-bottom: 48px;
}

.hero-tagline {
  font-size: clamp(38px, 9vw, 56px);
  font-weight: 800;
  color: var(--teal);
  line-height: 1.08;
  letter-spacing: -2px;
  margin-bottom: 20px;
  min-height: 1.2em;
}

.cursor {
  display: inline-block;
  width: 3px;
  height: 0.82em;
  background: var(--teal);
  margin-left: 3px;
  vertical-align: middle;
  border-radius: 2px;
  animation: blink 0.85s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.hero-sub {
  font-size: 18px;
  color: var(--text-soft);
  line-height: 1.55;
  margin-bottom: 44px;
  opacity: 0;
  animation: fadeIn 0.5s ease 1.9s forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: fadeIn 0.5s ease 2.2s forwards;
}

/* ============================================================
   CARD
   ============================================================ */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px 28px;
  width: 100%;
  max-width: 480px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.wordmark-sm {
  font-size: 15px;
  font-weight: 700;
  color: var(--teal);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  padding: 14px 28px;
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}

.btn-primary {
  background: var(--teal);
  color: var(--white);
}

.btn-primary:hover:not(:disabled) {
  background: var(--teal-mid);
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(26,92,71,0.28);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  color: var(--teal);
  border: 1.5px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--teal-mid);
  background: var(--teal-faint);
}

.btn-lg {
  font-size: 18px;
  padding: 16px 40px;
  border-radius: 14px;
}

.btn-full {
  width: 100%;
}

.btn-skip {
  margin-top: 10px;
  font-size: 14px;
  padding: 11px 20px;
}

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

.back-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
  transition: color 0.12s;
}

.back-btn:hover { color: var(--teal); }

/* ============================================================
   PROGRESS DOTS
   ============================================================ */
.progress-dots {
  display: flex;
  gap: 7px;
  justify-content: center;
  margin-bottom: 28px;
}

.progress-dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.3s ease;
}

.progress-dots .dot.done {
  background: var(--teal-faint-3);
}

.progress-dots .dot.active {
  background: var(--teal);
  width: 22px;
  border-radius: 4px;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
  margin-bottom: 6px;
  line-height: 1.2;
}

.step-sub {
  font-size: 15px;
  color: var(--text-soft);
  line-height: 1.55;
  margin-bottom: 24px;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group { margin-bottom: 20px; }

label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}

.input {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  appearance: none;
  font-family: inherit;
}

.input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26,92,71,0.09);
}

.input::placeholder { color: #c0c0c0; }

.input-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 38px;
}

.input-url {
  font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
  font-size: 13px;
  letter-spacing: -0.2px;
  color: var(--teal);
}

.error-msg {
  font-size: 13px;
  color: var(--error);
  margin-top: 8px;
  padding: 9px 12px;
  background: var(--error-bg);
  border-radius: 8px;
  line-height: 1.4;
}

/* ============================================================
   SCHOOL CARDS
   ============================================================ */
.school-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.school-card {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 18px 12px 14px;
  text-align: center;
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.school-card:hover {
  border-color: var(--teal-mid);
  background: var(--teal-faint);
}

.school-card.selected {
  border-color: var(--teal);
  background: var(--teal-faint);
  box-shadow: 0 0 0 3px rgba(26,92,71,0.10);
}

.school-abbr {
  font-size: 20px;
  font-weight: 800;
  color: var(--teal);
  letter-spacing: -0.5px;
}

.school-name {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.3;
}

/* ============================================================
   ICAL INSTRUCTIONS
   ============================================================ */
.ical-steps {
  background: var(--teal-faint);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.ical-step {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.45;
}

.ical-step-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: var(--teal);
  color: white;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.canvas-link {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
}

.canvas-link:hover { text-decoration: underline; }

/* ============================================================
   DROP ZONE
   ============================================================ */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
  margin-bottom: 14px;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--teal);
  background: var(--teal-faint);
}

.drop-zone.drag-over {
  animation: dropPulse 0.9s ease infinite;
}

@keyframes dropPulse {
  0%, 100% { border-color: var(--teal); }
  50%       { border-color: var(--teal-light); }
}

.drop-icon { font-size: 28px; margin-bottom: 8px; }

.drop-label {
  font-size: 15px;
  color: var(--text-soft);
  margin-bottom: 4px;
}

.file-label {
  color: var(--teal);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.drop-hint { font-size: 13px; color: var(--text-muted); }

/* ============================================================
   FILE CHIPS
   ============================================================ */
.file-chips {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
}

.file-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  background: var(--teal-faint);
  border-radius: 10px;
  font-size: 14px;
  animation: fadeUp 0.22s ease both;
}

.file-chip-icon { font-size: 15px; flex-shrink: 0; }

.file-chip-name {
  flex: 1;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.file-chip-count {
  font-size: 12px;
  color: var(--teal);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.chip-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.12s;
}

.chip-remove:hover { color: var(--error); }

/* ============================================================
   CONFIRMATION
   ============================================================ */
.confirm-loading {
  text-align: center;
  padding: 20px 0;
  color: var(--text-muted);
  font-size: 14px;
}

.loading-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  background: var(--teal-faint-3);
  border-radius: 50%;
  animation: dotBounce 1.1s ease infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.18s; }
.loading-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.75); opacity: 0.5; }
  40%           { transform: scale(1.2);  opacity: 1; }
}

.confirm-courses { margin-bottom: 20px; }

.confirm-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-top: 16px;
  margin-bottom: 4px;
}

.confirm-section-label:first-child { margin-top: 0; }

.confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  animation: fadeUp 0.28s ease both;
}

.confirm-row:last-child { border-bottom: none; }

.confirm-row-name {
  color: var(--text);
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 12px;
}

.confirm-row-count {
  color: var(--teal);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.confirm-empty {
  text-align: center;
  padding: 16px 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Collapsible syllabus course blocks */
.confirm-course-block {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
  animation: fadeUp 0.28s ease both;
}

.confirm-course-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: var(--teal-faint);
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.15s;
}

.confirm-course-header:hover { background: var(--teal-faint-2); }

.confirm-course-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 10px;
}

.confirm-course-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.confirm-course-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--teal);
}

.confirm-chevron {
  font-size: 13px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  line-height: 1;
}

.confirm-assignment-list {
  display: none;
  flex-direction: column;
}

.confirm-assignment-list.open { display: flex; }

.confirm-assignment-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  gap: 10px;
}

.assignment-title {
  font-size: 13px;
  color: var(--text-soft);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignment-date {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.assignment-empty {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  border-top: 1px solid var(--border);
}

/* Syllabus step — hint below disabled Continue */
.syllabus-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ============================================================
   SUCCESS
   ============================================================ */
.panel-success {
  background: linear-gradient(135deg, #EAF4F0, #D4EDE4);
}

.panel-success.active {
  justify-content: center;
  text-align: center;
}

.success-content {
  max-width: 400px;
  width: 100%;
  padding: 0 24px;
}

.success-icon {
  font-size: 52px;
  margin-bottom: 24px;
  display: block;
  animation: successPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes successPop {
  from { transform: scale(0.3); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.success-content h2 {
  font-size: 30px;
  color: var(--teal);
  margin-bottom: 16px;
  animation: fadeUp 0.4s ease 0.25s both;
}

.success-msg {
  font-size: 17px;
  color: var(--text-soft);
  line-height: 1.65;
  margin-bottom: 28px;
  white-space: pre-line;
  animation: fadeUp 0.4s ease 0.4s both;
}

.success-sig {
  font-size: 16px;
  color: var(--teal);
  font-weight: 600;
  animation: fadeIn 0.4s ease 0.65s both;
}

/* ============================================================
   SPINNER
   ============================================================ */
.spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}

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

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 520px) {
  .card { padding: 24px 18px 20px; }
  h2 { font-size: 21px; }
  .hero-sub { font-size: 16px; }
  .school-abbr { font-size: 18px; }
  .school-name { font-size: 11px; }
}
