/* ====================================================================
   HAON_SITEGEN_V1 — Intel-side launcher styles (chooser + full screen +
   floating window + "site no ar" success card + toast). Mirrors training.css:
   Palantir-light premium, tema-aware, reduced-motion safe. intel-web-sitegen.js
   builds the DOM.
   Paleta de marca: #2D3BFF (azul elétrico) · #7B5CFF (violeta) · #00D4FF (ciano)
   ==================================================================== */
:root {
  --sg-blue: #2D3BFF;
  --sg-violet: #7B5CFF;
  --sg-cyan: #00D4FF;
  --sg-ink: #141B2E;
  --sg-ink-soft: #51607A;
  --sg-line: rgba(20, 40, 90, .12);
  --sg-surface: #ffffff;
  --sg-grad: linear-gradient(135deg, #2D3BFF 0%, #7B5CFF 55%, #00D4FF 140%);
  --sg-shadow-lg: 0 24px 70px rgba(20, 30, 80, .30), 0 4px 14px rgba(20, 30, 80, .14);
  --sg-ease: cubic-bezier(.22, .61, .36, 1);
  --sg-spring: cubic-bezier(.18, .89, .32, 1.20);
}

/* ---- line icons ---- */
.sg-ic {
  width: 1.05em; height: 1.05em; flex: 0 0 auto; display: inline-block;
  vertical-align: -.16em; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

.sg-logo {
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 13px;
  display: grid; place-items: center; font-weight: 800; font-size: 21px; color: #fff;
  font-family: 'Outfit', system-ui, sans-serif; letter-spacing: -.02em;
  background: var(--sg-grad);
  box-shadow: 0 8px 22px rgba(45, 59, 255, .34), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.sg-logo.sm { width: 28px; height: 28px; font-size: 15px; border-radius: 9px; }

/* ====================================================================
   CHOOSER
   ==================================================================== */
.sg-chooser-backdrop {
  position: fixed; inset: 0; z-index: 9600; display: grid; place-items: center; padding: 20px;
  background: rgba(10, 16, 34, .52); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  animation: sgBackIn .18s var(--sg-ease) both;
}
.sg-chooser {
  position: relative; width: min(480px, 100%); background: var(--sg-surface); color: var(--sg-ink);
  border-radius: 24px; padding: 26px; border: 1px solid var(--sg-line);
  box-shadow: var(--sg-shadow-lg);
  animation: sgPopIn .24s var(--sg-spring) both;
}
.sg-x {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--sg-ink-soft); cursor: pointer; border-radius: 10px;
  transition: background .14s, color .14s, transform .14s var(--sg-ease);
}
.sg-x .sg-ic { width: 18px; height: 18px; }
.sg-x:hover { color: var(--sg-ink); background: rgba(20, 40, 90, .06); transform: rotate(90deg); }
.sg-chooser-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.sg-chooser-tt b { display: block; font-size: 19px; letter-spacing: -.02em; font-family: 'Outfit', system-ui, sans-serif; }
.sg-chooser-tt span { font-size: 13px; color: var(--sg-ink-soft); }

.sg-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.sg-card {
  display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer;
  padding: 18px 16px; border-radius: 18px; border: 1.5px solid var(--sg-line); background: #f7f9ff;
  color: var(--sg-ink); position: relative; overflow: hidden;
  transition: transform .16s var(--sg-spring), border-color .16s, box-shadow .22s, background .16s;
}
.sg-card:hover { transform: translateY(-3px); background: #fff; box-shadow: 0 16px 34px rgba(45, 59, 255, .16); }
.sg-card:active { transform: translateY(-1px) scale(.99); }
.sg-card-ic { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: var(--sg-blue); background: rgba(45, 59, 255, .09); margin-bottom: 2px; }
.sg-card-ic .sg-ic { width: 21px; height: 21px; }
.sg-card b { font-size: 15px; letter-spacing: -.01em; }
.sg-card span { font-size: 12px; color: var(--sg-ink-soft); line-height: 1.4; }

.sg-remember { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 12.5px; color: var(--sg-ink-soft); font-weight: 600; cursor: pointer; }
.sg-remember input { width: 16px; height: 16px; accent-color: var(--sg-blue); }

/* ====================================================================
   FULL SCREEN
   ==================================================================== */
.sg-full {
  position: fixed; inset: 0; z-index: 9500; display: flex; flex-direction: column;
  background: #0c1024;
  opacity: 0; transform: scale(.985);
  transition: opacity .22s var(--sg-ease), transform .26s var(--sg-ease);
}
.sg-full.sg-in { opacity: 1; transform: none; }
.sg-full-head {
  display: flex; align-items: center; gap: 11px; padding: 11px 16px;
  background: linear-gradient(180deg, #121838, #0c1024); border-bottom: 1px solid rgba(120, 150, 255, .18); color: #eef2ff;
}
.sg-full-head b { font-size: 14.5px; letter-spacing: -.01em; font-family: 'Outfit', system-ui, sans-serif; }
.sg-full-actions { margin-left: auto; display: flex; gap: 9px; }
.sg-full-actions button {
  display: inline-flex; align-items: center; gap: .4em; border: 1px solid rgba(150, 175, 255, .26);
  background: rgba(255, 255, 255, .06); color: #e4ebff; border-radius: 11px; padding: 9px 14px; min-height: 40px;
  font-size: 13px; font-weight: 700; cursor: pointer; transition: background .14s, border-color .14s, transform .14s var(--sg-spring);
}
.sg-full-actions button .sg-ic { width: 16px; height: 16px; }
.sg-full-actions button:hover { background: rgba(120, 160, 255, .2); border-color: rgba(150, 175, 255, .5); }
.sg-full-actions button:active { transform: scale(.96); }
body.sg-full-open { overflow: hidden; }

/* ====================================================================
   FLOATING OVERLAY
   ==================================================================== */
.sg-overlay {
  position: fixed; z-index: 9000; display: flex; flex-direction: column; overflow: hidden;
  min-width: 360px; min-height: 280px; border-radius: 18px; background: var(--sg-surface);
  border: 1px solid var(--sg-line);
  box-shadow: var(--sg-shadow-lg);
  opacity: 0; transform: translateY(10px) scale(.96); transform-origin: bottom right;
  transition: opacity .2s var(--sg-ease), transform .26s var(--sg-spring);
}
.sg-overlay.sg-in { opacity: 1; transform: none; }
.sg-ov-head {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px; cursor: grab; user-select: none;
  background: linear-gradient(180deg, #121838, #0c1024); color: #eef2ff; flex: 0 0 auto;
  border-bottom: 1px solid rgba(120, 150, 255, .14);
}
.sg-ov-head:active { cursor: grabbing; }
.sg-ov-grip { display: inline-grid; place-items: center; opacity: .55; color: #aab8ff; }
.sg-ov-grip .sg-ic { width: 17px; height: 17px; }
.sg-ov-head b { font-size: 13px; font-weight: 700; letter-spacing: -.01em; font-family: 'Outfit', system-ui, sans-serif; }
.sg-ov-btns { margin-left: auto; display: flex; gap: 5px; }
.sg-ov-btns button {
  width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 9px;
  background: rgba(255, 255, 255, .08); color: #dce6ff; cursor: pointer;
  transition: background .14s, color .14s, transform .12s var(--sg-spring);
}
.sg-ov-btns button .sg-ic { width: 16px; height: 16px; }
.sg-ov-btns button:hover { background: rgba(120, 160, 255, .26); }
.sg-ov-btns button:active { transform: scale(.88); }
.sg-ov-btns button[data-act="close"]:hover { background: rgba(255, 90, 110, .85); color: #fff; }
.sg-frame { flex: 1 1 auto; width: 100%; border: 0; display: block; background: #070709; }
.sg-ov-resize {
  position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 52%, rgba(45, 59, 255, .5) 52%); border-bottom-right-radius: 18px;
}
.sg-overlay.sg-min { height: auto !important; min-height: 0; box-shadow: 0 12px 30px rgba(20, 30, 80, .28); }
.sg-overlay.sg-min .sg-frame, .sg-overlay.sg-min .sg-ov-resize { display: none; }
.sg-overlay.sg-dragging { transition: none; }
.sg-overlay.sg-dragging .sg-frame { pointer-events: none; }

/* ====================================================================
   "SITE NO AR" SUCCESS CARD
   ==================================================================== */
.sg-done-backdrop {
  position: fixed; inset: 0; z-index: 9700; display: grid; place-items: center; padding: 20px;
  background: rgba(10, 16, 34, .58); backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  opacity: 0; transition: opacity .2s var(--sg-ease);
}
.sg-done-backdrop.sg-in { opacity: 1; }
.sg-done {
  position: relative; width: min(500px, 100%); background: var(--sg-surface); color: var(--sg-ink);
  border-radius: 24px; padding: 34px 28px 24px; border: 1px solid var(--sg-line);
  box-shadow: var(--sg-shadow-lg); text-align: center; overflow: hidden;
  transform: translateY(10px) scale(.96); transition: transform .3s var(--sg-spring);
}
.sg-done-backdrop.sg-in .sg-done { transform: none; }
.sg-done-burst {
  position: absolute; top: -60px; left: 50%; width: 320px; height: 320px; transform: translateX(-50%);
  background: radial-gradient(circle at 50% 50%, rgba(0, 212, 255, .22), rgba(123, 92, 255, .12) 45%, transparent 70%);
  pointer-events: none;
}
.sg-done-badge {
  position: relative; width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: var(--sg-grad);
  box-shadow: 0 12px 30px rgba(45, 59, 255, .42), inset 0 1px 0 rgba(255, 255, 255, .4);
  animation: sgBadgePop .42s var(--sg-spring) both;
}
.sg-done-badge .sg-ic { width: 30px; height: 30px; stroke-width: 2.4; }
.sg-done h3 { font-size: 22px; font-family: 'Outfit', system-ui, sans-serif; letter-spacing: -.02em; margin: 0 0 4px; }
.sg-done > p { font-size: 13.5px; color: var(--sg-ink-soft); margin: 0 0 18px; }

.sg-link-row {
  display: flex; gap: 8px; align-items: stretch; margin-bottom: 16px;
  background: #f4f6ff; border: 1.5px solid var(--sg-line); border-radius: 14px; padding: 6px;
}
.sg-link-row input {
  flex: 1 1 auto; min-width: 0; border: 0; background: transparent; color: var(--sg-blue);
  font-size: 14.5px; font-weight: 700; padding: 0 10px; outline: none;
  text-overflow: ellipsis; font-family: 'Inter', system-ui, monospace;
}
.sg-copy {
  display: inline-flex; align-items: center; gap: .4em; flex: 0 0 auto; border: 0; cursor: pointer;
  background: var(--sg-grad); color: #fff; border-radius: 10px; padding: 0 14px; min-height: 40px;
  font-size: 13px; font-weight: 800; font-family: 'Outfit', system-ui, sans-serif;
  box-shadow: 0 6px 16px rgba(45, 59, 255, .34);
  transition: transform .14s var(--sg-spring), box-shadow .2s;
}
.sg-copy .sg-ic { width: 15px; height: 15px; }
.sg-copy:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(45, 59, 255, .45); }
.sg-copy:active { transform: scale(.95); }
.sg-copy.ok { background: linear-gradient(135deg, #14b88a, #0fd6a0); box-shadow: 0 6px 16px rgba(15, 200, 140, .4); }

.sg-done-actions { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; }
.sg-btn {
  display: inline-flex; align-items: center; gap: .45em; min-height: 42px; padding: 0 18px;
  border-radius: 12px; font-size: 13.5px; font-weight: 800; cursor: pointer;
  font-family: 'Outfit', system-ui, sans-serif; border: 1px solid transparent;
  transition: transform .14s var(--sg-spring), box-shadow .2s, background .16s, border-color .16s;
}
.sg-btn .sg-ic { width: 16px; height: 16px; }
.sg-btn:active { transform: scale(.96); }
.sg-primary { color: #fff; background: var(--sg-grad); box-shadow: 0 8px 22px rgba(45, 59, 255, .4); }
.sg-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(45, 59, 255, .5); }
.sg-ghost { color: var(--sg-ink); background: #f4f6ff; border-color: var(--sg-line); }
.sg-ghost:hover { background: #fff; border-color: var(--sg-blue); transform: translateY(-1px); }

/* ====================================================================
   TOAST
   ==================================================================== */
.sg-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px); z-index: 9800;
  max-width: min(440px, 92vw); padding: 13px 18px; border-radius: 13px;
  background: #121838; color: #eef2ff; font-size: 13.5px; font-weight: 600; line-height: 1.4;
  border: 1px solid rgba(120, 150, 255, .26); box-shadow: 0 16px 40px rgba(10, 16, 34, .4);
  opacity: 0; transition: opacity .26s var(--sg-ease), transform .26s var(--sg-spring);
}
.sg-toast.sg-in { opacity: 1; transform: translate(-50%, 0); }
.sg-toast-err { background: #2a1620; border-color: rgba(255, 120, 140, .4); color: #ffdbe2; }

/* ====================================================================
   DARK THEME
   ==================================================================== */
[data-theme="dark"] .sg-chooser, [data-theme="stone-dark"] .sg-chooser,
[data-theme="dark"] .sg-done, [data-theme="stone-dark"] .sg-done { background: #161b26; color: #eaf0fb; border-color: rgba(140, 165, 215, .18); }
[data-theme="dark"] .sg-chooser-tt span, [data-theme="stone-dark"] .sg-chooser-tt span,
[data-theme="dark"] .sg-card span, [data-theme="stone-dark"] .sg-card span,
[data-theme="dark"] .sg-done > p, [data-theme="stone-dark"] .sg-done > p { color: #a6b6d6; }
[data-theme="dark"] .sg-card, [data-theme="stone-dark"] .sg-card { background: rgba(255, 255, 255, .04); border-color: rgba(150, 175, 215, .16); color: #eaf0fb; }
[data-theme="dark"] .sg-card:hover, [data-theme="stone-dark"] .sg-card:hover { background: rgba(255, 255, 255, .07); }
[data-theme="dark"] .sg-card-ic, [data-theme="stone-dark"] .sg-card-ic { background: rgba(123, 92, 255, .18); color: #b7a6ff; }
[data-theme="dark"] .sg-overlay, [data-theme="stone-dark"] .sg-overlay { background: #11151e; border-color: rgba(140, 165, 215, .2); }
[data-theme="dark"] .sg-link-row, [data-theme="stone-dark"] .sg-link-row { background: rgba(255, 255, 255, .05); border-color: rgba(150, 175, 215, .2); }
[data-theme="dark"] .sg-link-row input, [data-theme="stone-dark"] .sg-link-row input { color: #9fc7ff; }
[data-theme="dark"] .sg-ghost, [data-theme="stone-dark"] .sg-ghost { background: rgba(255, 255, 255, .05); color: #eaf0fb; border-color: rgba(150, 175, 215, .2); }
[data-theme="dark"] .sg-ghost:hover, [data-theme="stone-dark"] .sg-ghost:hover { background: rgba(255, 255, 255, .09); }

/* ====================================================================
   ANIMATIONS + RESPONSIVE + REDUCED MOTION
   ==================================================================== */
@keyframes sgBackIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sgPopIn { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes sgBadgePop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }

@media (max-width: 560px) {
  .sg-cards { grid-template-columns: 1fr; }
  .sg-chooser { padding: 22px; border-radius: 20px; }
  .sg-full-actions button span { display: none; }
  .sg-done-actions { flex-direction: column; }
  .sg-done-actions .sg-btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .sg-chooser-backdrop, .sg-chooser, .sg-full, .sg-overlay, .sg-done-backdrop, .sg-done,
  .sg-card, .sg-x, .sg-ov-btns button, .sg-full-actions button, .sg-done-badge, .sg-copy, .sg-btn, .sg-toast {
    animation: none !important; transition: none !important;
  }
  .sg-full, .sg-overlay, .sg-done-backdrop, .sg-toast { opacity: 1; transform: none; }
}
/* ===== HAON_SITEGEN_V1_END ===== */
