/* CertificationComplete.css
   Styles for the standalone "Certification Complete" success modal.
   All rules are scoped under .cc-* to avoid collisions. */

/* ── Backdrop ──────────────────────────────────────────────────────────────── */
.cc-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1060;
  opacity: 0;
  transition: opacity 0.2s ease;
  padding: 1rem;
}

.cc-backdrop--visible {
  opacity: 1;
}

/* ── Dialog ────────────────────────────────────────────────────────────────── */
.cc-dialog {
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 480px;
  /* NOTE: overflow must NOT be hidden — tooltip lives outside dialog anyway,
     but keeping it visible prevents any future clipping issues. */
  overflow: visible;
  display: flex;
  flex-direction: column;
  transform: translateY(10px) scale(0.98);
  transition: transform 0.25s ease;
}

.cc-backdrop--visible .cc-dialog {
  transform: translateY(0) scale(1);
}

/* ── Header ────────────────────────────────────────────────────────────────── */
.cc-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--acec-border, #dee2e6);
  border-radius: 0.5rem 0.5rem 0 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cc-header-title {
  font-family: var(--font-main, 'Raleway', sans-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--acec-navy, #213138);
  margin: 0;
}

/* Close button */
.cc-btn-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: transparent;
  border: 1px solid var(--acec-gold, #f7c95d);
  border-radius: 0.25rem;
  color: var(--acec-navy, #213138);
  cursor: pointer;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.cc-btn-close svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
}

.cc-btn-close:hover {
  background-color: var(--acec-gold, #f7c95d);
}

/* ── Body ──────────────────────────────────────────────────────────────────── */
.cc-body {
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
  position: relative;
  background: #fff;
}

/* ── Confetti ──────────────────────────────────────────────────────────────── */
.cc-confetti-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 0 0 0.5rem 0.5rem;
}

.cc-confetti-particle {
  position: absolute;
  opacity: 0;
  animation: ccConfettiFall 2.5s ease-out forwards;
  border-radius: 2px;
}

@keyframes ccConfettiFall {
  0%   { opacity: 1; transform: translateY(-30px) rotate(0deg) scale(1); }
  50%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(350px) rotate(720deg) scale(0.3); }
}

/* ── Icon wrap ─────────────────────────────────────────────────────────────── */
.cc-icon-wrap {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  position: relative;
  transition: background 0.5s ease;
}

/* Celebrating — amber/orange gradient + pulse */
.cc-icon-celebrating {
  background: linear-gradient(135deg, #fef3c7, #fed7aa);
  animation: ccPulse 0.6s ease-in-out 3;
}

/* Complete — green */
.cc-icon-complete {
  background: #dcfce7;
}

@keyframes ccPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.1); }
}

/* ── Icon layers (party popper & check stacked) ────────────────────────────── */
.cc-icon-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

.cc-icon-layer--party {
  opacity: 1;
}

/* Lucide SVG inside party layer — amber */
.cc-icon-layer--party svg {
  width: 2rem;
  height: 2rem;
  stroke: #d97706;
}

.cc-icon-layer--check {
  opacity: 0;
}

/* Lucide SVG inside check layer — green, filled appearance via stroke */
.cc-icon-layer--check svg {
  width: 2rem;
  height: 2rem;
  stroke: #16a34a;
}

/* Applied by JS at T+3500ms */
.cc-icon-layer--hidden {
  opacity: 0 !important;
}

.cc-icon-layer--shown {
  opacity: 1 !important;
}

/* ── Title ─────────────────────────────────────────────────────────────────── */
.cc-title {
  font-family: var(--font-main, 'Raleway', sans-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--acec-navy, #213138);
  margin: 0 0 0.4rem;
  line-height: 1.4;
}

/* ── Sub line ──────────────────────────────────────────────────────────────── */
.cc-sub {
  font-family: var(--font-main, 'Raleway', sans-serif);
  font-size: 0.85rem;
  color: var(--acec-gray, #6c757d);
  margin: 0 0 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── Help (?) button ───────────────────────────────────────────────────────── */
.cc-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--acec-muted, #adb5bd);
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
  position: relative;   /* anchor for z-index stacking */
}

.cc-help-btn svg {
  width: 0.95rem;
  height: 0.95rem;
  stroke: currentColor;
}

.cc-help-btn:hover,
.cc-help-btn:focus {
  color: var(--acec-gold-dark, #b8860b);
  outline: none;
}

/* ── Tooltip — fixed inside backdrop, positioned by JS ────────────────────── */
/* Lives as a direct child of .cc-backdrop so it is never clipped by the dialog */
.cc-help-tooltip {
  position: fixed;        /* positioned via JS using getBoundingClientRect */
  width: 280px;
  background: #fff;
  border: 1px solid var(--acec-border, #dee2e6);
  border-radius: 0.375rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  padding: 0.75rem 0.875rem;
  text-align: left;
  font-family: var(--font-main, 'Raleway', sans-serif);
  font-size: 0.775rem;
  color: var(--acec-gray, #6c757d);
  line-height: 1.5;
  /* JS sets top to the button's top; we shift up by 100% + arrow gap */
  transform: translateY(calc(-100% - 10px));
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 1070;   /* above the backdrop (1060) */
}

/* Arrow pointing downward */
.cc-help-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #fff;
  filter: drop-shadow(0 1px 0 var(--acec-border, #dee2e6));
}

.cc-help-tooltip--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.cc-help-tooltip p {
  margin: 0 0 0.5rem;
}

.cc-help-tooltip p:last-child {
  margin-bottom: 0;
}

.cc-help-tooltip a {
  color: var(--acec-gold-dark, #b8860b);
  text-decoration: none;
}

.cc-help-tooltip a:hover {
  text-decoration: underline;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
.cc-footer {
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: flex-end;
  background: #fff;
  border-radius: 0 0 0.5rem 0.5rem;
}

/* ── Done button ───────────────────────────────────────────────────────────── */
.cc-btn-done {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.75rem;
  background: var(--acec-gold, #f7c95d) !important;
  border: 1px solid var(--acec-gold, #f7c95d) !important;
  color: var(--acec-navy, #213138) !important;
  font-family: var(--font-btn, 'Raleway', sans-serif);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.cc-btn-done:hover {
  opacity: 0.85;
}

.cc-btn-done:focus,
.cc-btn-done:active {
  box-shadow: 0 0 0 0.2rem rgba(247, 201, 93, 0.3) !important;
  outline: none;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .cc-dialog {
    max-width: 100%;
  }

  .cc-body {
    padding: 1.5rem 1rem 1rem;
  }

  .cc-title {
    font-size: 0.95rem;
  }

  .cc-help-tooltip {
    width: 240px;
  }
}
