/* ============================================================
   Favicon Generator v2.0 — base.css
   Classes  : fg-favicon-gen-*
   Approach : Mobile-first (base = mobile, @media min-width = desktop)
   Brand    : #42B5A4 (teal) · Inter — same design system as the
              rest of ImgTry (Circle Crop, converters)
   Contains : tokens, reset, header, stepper, panels, buttons, toast
   ============================================================ */


/* ══════════════════════════════════════════
   0. BASE / RESET / BRAND TOKENS
   ══════════════════════════════════════════ */
.fg-favicon-gen-wrap,
.fg-favicon-gen-wrap * {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  /* Defined on :root (not the wrapper) so the toast — a sibling of
     <main> — inherits them too. */
  --fg-brand: #42B5A4;
  --fg-brand-dark: #2E8577;
  --fg-brand-soft: #E8F8F6;

  --fg-ink: #1a1a22;
  --fg-ink-soft: #55555f;
  --fg-line: #e4e4ee;
  --fg-line-strong: #c4c4d4;
  --fg-bg: #f5f5fa;
  --fg-error: #c0392b;

  /* Radius scale */
  --fg-r-sm: 10px;
  --fg-r-md: 14px;
  --fg-r-lg: 20px;
  --fg-r-pill: 9999px;
}

body {
  margin: 0;
  background: #fff;
}

.fg-favicon-gen-wrap {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 56px;
  touch-action: manipulation;
  overscroll-behavior-y: contain;
  color: var(--fg-ink);
}

.fg-favicon-gen-wrap button,
.fg-favicon-gen-wrap input {
  font-family: inherit;
}

[hidden] {
  display: none !important;
}


/* ══════════════════════════════════════════
   1. HEADER
   ══════════════════════════════════════════ */
.fg-favicon-gen-header {
  text-align: center;
  margin-bottom: 24px;
}

.fg-favicon-gen-header__title {
  font-weight: 800;
  font-size: clamp(1.5rem, 6vw, 2.2rem);
  letter-spacing: -0.8px;
  color: var(--fg-ink);
  margin: 0 0 8px;
}

.fg-favicon-gen-header__title strong {
  font-weight: 900;
  color: var(--fg-brand);
}

.fg-favicon-gen-header__subtitle {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--fg-ink-soft);
  line-height: 1.6;
  margin: 0;
}

.fg-favicon-gen-header__subtitle a {
  color: var(--fg-brand-dark);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(66, 181, 164, 0.4);
  text-underline-offset: 2px;
}

.fg-favicon-gen-header__subtitle a:hover,
.fg-favicon-gen-header__subtitle a:focus-visible {
  color: var(--fg-brand);
  text-decoration-color: currentColor;
}

.fg-favicon-gen-header__subtitle a:focus-visible {
  outline: 2px solid var(--fg-brand);
  outline-offset: 2px;
  border-radius: 3px;
}

.fg-favicon-gen-header__note {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg-ink-soft);
  opacity: 0.8;
  margin: 10px 0 0;
}


/* ══════════════════════════════════════════
   2. STEPPER
   ══════════════════════════════════════════ */
.fg-favicon-gen-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 28px;
}

.fg-favicon-gen-stepper__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.fg-favicon-gen-stepper__dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #8a8a94;
  background: #fff;
  border: 1.5px solid var(--fg-line);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.fg-favicon-gen-stepper__step.is-active .fg-favicon-gen-stepper__dot {
  background: var(--fg-brand);
  border-color: var(--fg-brand);
  color: #fff;
}

.fg-favicon-gen-stepper__step.is-done .fg-favicon-gen-stepper__dot {
  background: var(--fg-brand-soft);
  border-color: var(--fg-brand);
  color: var(--fg-brand-dark);
}

.fg-favicon-gen-stepper__dot--export {
  width: auto;
  border-radius: var(--fg-r-pill);
  padding: 0 16px;
  font-size: 12px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.fg-favicon-gen-stepper__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-ink-soft);
}

.fg-favicon-gen-stepper__line {
  width: 28px;
  height: 2px;
  background: var(--fg-line);
  margin-top: -18px;
}


/* ══════════════════════════════════════════
   3. PANELS
   ══════════════════════════════════════════ */
.fg-favicon-gen-panel {
  display: none;
}

.fg-favicon-gen-panel.is-active {
  display: block;
  animation: fgFadeIn 0.28s ease both;
}

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


/* ══════════════════════════════════════════
   4. ACTION BUTTONS (shared across all 3 steps)
   ══════════════════════════════════════════ */
.fg-favicon-gen-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.fg-favicon-gen-btn {
  flex: 1;
  height: 48px;
  border-radius: var(--fg-r-pill);
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  border: 1.5px solid transparent;
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
}

.fg-favicon-gen-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.fg-favicon-gen-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--fg-brand-soft), 0 0 0 5.5px var(--fg-brand);
}

.fg-favicon-gen-btn--primary {
  background: var(--fg-brand);
  color: #fff;
  box-shadow: 0 2px 10px rgba(66,181,164,0.28);
}

.fg-favicon-gen-btn--primary:active:not(:disabled) {
  transform: scale(0.98);
}

.fg-favicon-gen-btn--ghost {
  background: #fff;
  border-color: var(--fg-line);
  color: var(--fg-ink);
}

.fg-favicon-gen-btn--ghost:active:not(:disabled) {
  background: var(--fg-bg);
}

/* Secondary = "download one by one" — sits between ghost and primary */
.fg-favicon-gen-btn--secondary {
  background: var(--fg-brand-soft);
  border-color: var(--fg-brand-soft);
  color: var(--fg-brand-dark);
}

.fg-favicon-gen-btn--secondary:active:not(:disabled) {
  background: #d9f2ee;
}


/* ══════════════════════════════════════════
   5. TOAST
   ══════════════════════════════════════════ */
.fg-favicon-gen-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px) scale(0.96);
  display: inline-flex;
  align-items: center;
  gap: 11px;
  background: var(--fg-ink);
  color: #fff;
  padding: 13px 20px 13px 15px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 999;
  box-shadow: 0 12px 32px rgba(0,0,0,0.24), 0 2px 8px rgba(0,0,0,0.14);
  max-width: 90vw;
  text-align: left;
}

.fg-favicon-gen-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.fg-favicon-gen-toast::before {
  content: '✓';
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.fg-favicon-gen-toast.is-error {
  background: var(--fg-error);
}

.fg-favicon-gen-toast.is-error::before {
  content: '!';
}


/* ══════════════════════════════════════════
   6. DESKTOP ENHANCEMENTS (≥768px)
   ══════════════════════════════════════════ */
@media (min-width: 768px) {
  .fg-favicon-gen-wrap {
    padding: 40px 24px 72px;
  }

  .fg-favicon-gen-header__subtitle {
    font-size: 16px;
  }

  .fg-favicon-gen-stepper {
    gap: 10px;
    margin-bottom: 36px;
  }

  .fg-favicon-gen-stepper__line {
    width: 56px;
  }

  .fg-favicon-gen-btn--ghost:hover:not(:disabled) {
    border-color: var(--fg-ink);
  }

  .fg-favicon-gen-btn--primary:hover:not(:disabled) {
    background: var(--fg-brand-dark);
    box-shadow: 0 4px 16px rgba(66,181,164,0.36);
  }

  .fg-favicon-gen-btn--secondary:hover:not(:disabled) {
    background: #d9f2ee;
  }

  .fg-favicon-gen-actions {
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }

  .fg-favicon-gen-actions--export {
    max-width: 560px;
  }
}


/* ══════════════════════════════════════════
   7. ACCESSIBILITY
   ══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .fg-favicon-gen-panel.is-active {
    animation: none;
  }

  .fg-favicon-gen-btn,
  .fg-favicon-gen-stepper__dot {
    transition: none;
  }

  .fg-favicon-gen-toast {
    transition: opacity 0.15s ease;
    transform: translate(-50%, 0) scale(1);
  }
}
