/* ============================================================
   ap-first-success.css — First Success Experience™
   Academic Planner AI
   ============================================================ */

/* ============== WELCOME CARD ============== */

.fse-welcome {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fse-welcome.is-open {
  opacity: 1;
}

.fse-welcome__card {
  background: #fff;
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  padding: 44px 40px 36px;
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.22);
  animation: fse-card-up 0.42s cubic-bezier(0.21, 0.47, 0.32, 0.98) forwards;
  text-align: center;
}

@keyframes fse-card-up {
  from { transform: translateY(40px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1);       opacity: 1; }
}

.fse-welcome__icon {
  font-size: 3.2rem;
  display: block;
  margin-bottom: 18px;
  line-height: 1;
  animation: fse-bounce 0.6s 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes fse-bounce {
  0%, 100% { transform: translateY(0); }
  30%       { transform: translateY(-10px); }
  60%       { transform: translateY(-4px); }
}

.fse-welcome__title {
  font-size: 1.55rem;
  font-weight: 800;
  color: #1E3A8A;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.fse-welcome__text {
  font-size: 0.93rem;
  color: #475569;
  line-height: 1.65;
  margin-bottom: 28px;
}

.fse-welcome__steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 28px;
}

.fse-welcome__step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.87rem;
  color: #475569;
}

.fse-welcome__step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E3A8A, #2563EB);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fse-welcome__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.fse-welcome__cta {
  width: 100%;
  max-width: 260px;
}

.fse-welcome__later {
  background: none;
  border: none;
  color: #94A3B8;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 8px;
  transition: color 0.15s;
}
.fse-welcome__later:hover { color: #64748B; }

/* ============== FLOATING PROGRESS WIDGET ============== */

.fse-widget {
  position: fixed;
  right: 24px;
  bottom: 88px;
  z-index: 200;
  width: 280px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  animation: fse-widget-in 0.35s cubic-bezier(0.21, 0.47, 0.32, 0.98) forwards;
}

@keyframes fse-widget-in {
  from { transform: translateY(16px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1);        opacity: 1; }
}

.fse-widget__hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
  cursor: pointer;
  user-select: none;
}

.fse-widget__hd-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fse-widget__trophy {
  font-size: 1.1rem;
  line-height: 1;
}

.fse-widget__title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #1E3A8A;
}

.fse-widget__hd-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fse-widget__pct {
  font-size: 0.78rem;
  font-weight: 700;
  color: #2563EB;
}

.fse-widget__toggle {
  background: none;
  border: none;
  color: #94A3B8;
  font-size: 0.7rem;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  transition: color 0.15s;
}
.fse-widget__toggle:hover { color: #475569; }

.fse-widget__bar-wrap {
  height: 3px;
  background: #F1F5F9;
  margin: 0 14px 0;
}

.fse-widget__bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563EB, #10B981);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 2px;
}

.fse-widget__body {
  padding: 10px 14px 14px;
  overflow: hidden;
  transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.22s ease,
              padding 0.22s ease;
  max-height: 300px;
  opacity: 1;
}

.fse-widget__body.is-collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* ============== STEPS (inside widget) ============== */

.fse-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fse-step {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.82rem;
  color: #94A3B8;
  transition: color 0.25s ease;
}

.fse-step.is-done {
  color: #334155;
}

.fse-step.is-current {
  color: #1E3A8A;
  font-weight: 600;
}

.fse-step__check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #E2E8F0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 800;
  color: transparent;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease,
              transform 0.3s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.fse-step.is-done .fse-step__check {
  background: #10B981;
  border-color: #10B981;
  color: #fff;
  transform: scale(1.1);
}

.fse-step.is-current .fse-step__check {
  border-color: #2563EB;
  background: rgba(37, 99, 235, 0.08);
}

.fse-widget__cta {
  display: block;
  margin-top: 12px;
  text-align: center;
  background: #1E3A8A;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.fse-widget__cta:hover { background: #2563EB; }

/* ============== CELEBRATION TOAST ============== */

.fse-celebration {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  z-index: 1200;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 14px 22px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.16);
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 280px;
  max-width: 420px;
  transition: transform 0.38s cubic-bezier(0.21, 0.47, 0.32, 0.98),
              opacity 0.28s ease;
  opacity: 0;
}

.fse-celebration.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.fse-celebration__emoji {
  font-size: 2rem;
  flex-shrink: 0;
  line-height: 1;
  animation: fse-bounce 0.5s 0.2s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.fse-celebration__title {
  font-weight: 800;
  font-size: 0.93rem;
  color: #1E3A8A;
  margin-bottom: 2px;
}

.fse-celebration__msg {
  font-size: 0.83rem;
  color: #475569;
  line-height: 1.4;
}

.fse-celebration__bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563EB, #10B981);
  border-radius: 0 0 0 14px;
  animation: fse-toast-bar 4s linear forwards;
}

@keyframes fse-toast-bar {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ============== FINAL COMPLETION SCREEN ============== */

.fse-final {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.fse-final.is-open {
  opacity: 1;
}

.fse-final__card {
  background: #fff;
  border-radius: 24px;
  width: 100%;
  max-width: 500px;
  padding: 48px 44px 40px;
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.22);
  animation: fse-card-up 0.45s cubic-bezier(0.21, 0.47, 0.32, 0.98) forwards;
  text-align: center;
}

.fse-final__trophy {
  font-size: 4rem;
  display: block;
  margin-bottom: 20px;
  line-height: 1;
  animation: fse-bounce 0.7s 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.fse-final__title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #1E3A8A;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.fse-final__text {
  font-size: 0.93rem;
  color: #475569;
  line-height: 1.65;
  margin-bottom: 28px;
}

.fse-final__stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(135deg, #F0FDF4, #EFF6FF);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 14px;
  padding: 18px 24px;
  margin-bottom: 28px;
  text-align: left;
}

.fse-final__stat {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: #334155;
  font-weight: 500;
}

.fse-final__stat-check {
  font-size: 0.72rem;
  font-weight: 800;
  color: #10B981;
  width: 18px;
  height: 18px;
  background: rgba(16, 185, 129, 0.12);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fse-final__cta {
  width: 100%;
  max-width: 240px;
  display: inline-block;
}

/* ============== RESPONSIVE ============== */

@media (max-width: 600px) {
  .fse-widget {
    right: 12px;
    bottom: 76px;
    width: calc(100vw - 24px);
    max-width: 320px;
  }

  .fse-welcome__card,
  .fse-final__card {
    padding: 32px 24px 28px;
  }

  .fse-welcome__title,
  .fse-final__title {
    font-size: 1.25rem;
  }

  .fse-celebration {
    max-width: calc(100vw - 32px);
  }
}
