/* [S475.8] my-vitto global styles — vanilla CSS, no SCSS preprocessing.
 *
 * Tokens, reset, and minimal page chrome. The platform-* custom elements
 * own their own shadow-DOM styles; we only style the light-DOM wrappers
 * our pages compose (mv-landing, mv-bridge, mv-error).
 *
 * Material icons font is loaded lazily by the iframe panels when needed
 * to keep the vanilla shell's initial payload small.
 */

:root {
  --mv-bg: #0b0e14;
  --mv-surface: #0f0f17;
  --mv-surface-2: #1a1a2e;
  --mv-text: #e2e8f0;
  --mv-text-muted: #94a3b8;
  --mv-primary: #6366f1;
  --mv-primary-soft: rgba(99, 102, 241, 0.18);
  --mv-border: rgba(255, 255, 255, 0.08);
  --mv-accent-grad: linear-gradient(135deg, #6366f1, #ec4899);

  --ux-bg: var(--mv-bg);
  --ux-surface: var(--mv-surface);
  --ux-border: var(--mv-border);
  --ux-text: var(--mv-text);

  color-scheme: dark light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--mv-bg);
  color: var(--mv-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
}

my-vitto-app {
  display: block;
  flex: 1;
  min-height: 100vh;
  width: 100%;
}

html,
body {
  height: 100%;
}

/* ── Landing ──────────────────────────────────────────────────────── */
.mv-landing {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.mv-landing__card {
  display: block;
  max-width: 480px;
  padding: 32px;
  background: rgba(15, 15, 23, 0.72);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  text-align: center;
}

.mv-landing__title {
  margin: 0 0 8px;
  font-size: 32px;
  letter-spacing: -0.02em;
  background: var(--mv-accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mv-landing__tagline {
  margin: 0 0 16px;
  font-size: 16px;
  color: var(--mv-text);
}

.mv-landing__blurb {
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--mv-text-muted);
  line-height: 1.5;
}

.mv-landing__cta,
.mv-error__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  background: var(--mv-primary);
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.18s ease, transform 0.18s ease;
}

.mv-landing__cta:hover,
.mv-error__cta:hover {
  background: #818cf8;
  transform: translateY(-1px);
}

.mv-landing__dev-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 12px;
  color: var(--mv-text-muted);
  text-decoration: underline;
}

/* ── Canvas page ──────────────────────────────────────────────────── */
/* The canvas page composes <platform-app-shell> + <platform-canvas> + two
 * <platform-embeddable-host> iframes. SDK shells expect 100% of their
 * parent's box; make sure the parent has one. */
my-vitto-app:has(platform-app-shell) {
  display: block;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
}

/* Fallback for browsers without :has() — when the canvas page mounts the
 * shell, every direct child needs a real box. Anchoring the my-vitto-app
 * root at full viewport height covers the case. */
my-vitto-app {
  height: 100vh;
}

platform-app-shell {
  display: block;
  width: 100%;
  height: 100%;
}

platform-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 240px;
  /* The welcome overlay positions itself absolutely against the canvas; it
   * needs a containing block. */
  position: relative;
  overflow: hidden;
}

/* Welcome / empty-state overlay — visible only when the canvas has no IR.
 * <platform-canvas> toggles aria-hidden on this element based on state. */
.platform-canvas__empty[aria-hidden="true"] {
  display: none !important;
}

platform-embeddable-host {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── Auth bridge ──────────────────────────────────────────────────── */
.mv-bridge {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.mv-bridge__card {
  display: grid;
  place-items: center;
  gap: 16px;
  padding: 32px;
  background: rgba(15, 15, 23, 0.72);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.mv-bridge__msg {
  margin: 0;
  font-size: 14px;
  color: var(--mv-text);
}

/* ── Error ────────────────────────────────────────────────────────── */
.mv-error {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.mv-error__card {
  display: block;
  max-width: 480px;
  padding: 32px;
  background: rgba(15, 15, 23, 0.72);
  border: 1px solid var(--mv-border);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  text-align: center;
}

.mv-error__title {
  margin: 0 0 12px;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.mv-error__body {
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--mv-text-muted);
  line-height: 1.5;
}

.mv-error__code {
  display: block;
  margin-top: 12px;
  font-size: 11px;
  color: var(--mv-text-muted);
  opacity: 0.6;
}
