/* Premium app shell for pesquisas */
:root {
  --ps-bg: #06100f;
  --ps-bg-2: #0a1715;
  --ps-surface: rgba(14, 28, 26, 0.86);
  --ps-surface-strong: #10201d;
  --ps-card: rgba(18, 33, 31, 0.82);
  --ps-card-soft: rgba(45, 212, 191, 0.08);
  --ps-border: rgba(157, 241, 229, 0.14);
  --ps-border-strong: rgba(45, 212, 191, 0.34);
  --ps-text: #f6fffd;
  --ps-muted: #a8bbb7;
  --ps-subtle: #728783;
  --ps-primary: #2dd4bf;
  --ps-primary-strong: #99f6e4;
  --ps-primary-ink: #04201c;
  --ps-accent: #f6c76d;
  --ps-danger: #fb7185;
  --ps-success: #5eead4;
  --ps-warning: #fbbf24;
  --ps-radius-xs: 10px;
  --ps-radius-sm: 14px;
  --ps-radius-md: 22px;
  --ps-radius-lg: 32px;
  --ps-shadow: 0 26px 80px rgba(0, 0, 0, 0.32);
  --ps-shadow-soft: 0 18px 42px rgba(0, 0, 0, 0.18);
  --ps-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-lab-app="pesquisas-premium"] {
  color-scheme: dark;
  background: var(--ps-bg);
}

html[data-lab-app="pesquisas-premium"] body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 10%, rgba(45, 212, 191, 0.20), transparent 34rem),
    radial-gradient(circle at 82% 8%, rgba(246, 199, 109, 0.14), transparent 30rem),
    linear-gradient(180deg, #081412 0%, #06100f 46%, #040908 100%);
  color: var(--ps-text);
  font-family: var(--ps-font);
}

html[data-lab-app="pesquisas-premium"] * { box-sizing: border-box; }
html[data-lab-app="pesquisas-premium"] button,
html[data-lab-app="pesquisas-premium"] input,
html[data-lab-app="pesquisas-premium"] select,
html[data-lab-app="pesquisas-premium"] textarea { font: inherit; }
html[data-lab-app="pesquisas-premium"] [hidden] { display: none !important; }

.ps-shell {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.ps-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.ps-container {
  width: min(100% - 40px, 1220px);
  margin-inline: auto;
}

.ps-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(157, 241, 229, 0.08);
  background: rgba(4, 12, 11, 0.78);
  backdrop-filter: blur(22px);
}

.ps-nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.ps-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ps-text);
  text-decoration: none;
  font-weight: 900;
  letter-spacing: -0.04em;
  font-size: 1.22rem;
}

.ps-brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: var(--ps-primary-ink);
  background: linear-gradient(135deg, var(--ps-primary), var(--ps-primary-strong));
  box-shadow: 0 14px 34px rgba(45, 212, 191, 0.24);
}

.ps-nav-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.ps-user-chip {
  max-width: 320px;
  overflow: hidden;
  color: var(--ps-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
}

.ps-main { padding: 34px 0 92px; }

.ps-login-card {
  width: min(100%, 860px);
  margin: clamp(44px, 8vw, 96px) auto 0;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-lg);
  background: linear-gradient(145deg, rgba(18, 33, 31, 0.92), rgba(12, 23, 21, 0.86));
  box-shadow: var(--ps-shadow);
  padding: clamp(24px, 5vw, 48px);
  display: grid;
  gap: 22px;
}

.ps-login-card h1,
.ps-hero h1 {
  margin: 0;
  color: var(--ps-text);
  letter-spacing: -0.06em;
  line-height: 0.96;
}

.ps-login-card h1 { font-size: clamp(2.1rem, 5vw, 4.6rem); }
.ps-hero h1 { font-size: clamp(2rem, 4.2vw, 4.1rem); }

.ps-login-card p,
.ps-hero p,
.ps-muted {
  margin: 0;
  color: var(--ps-muted);
  line-height: 1.65;
}

.ps-login-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.ps-login-mini {
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm);
  background: rgba(255,255,255,0.03);
  padding: 14px;
}

.ps-login-mini strong { display: block; margin-bottom: 4px; }
.ps-login-mini span { color: var(--ps-muted); font-size: 0.9rem; }

.ps-app { display: grid; gap: 22px; }

.ps-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
  align-items: stretch;
}

.ps-hero-copy,
.ps-metric-board,
.ps-panel {
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-lg);
  background: var(--ps-surface);
  box-shadow: var(--ps-shadow-soft);
}

.ps-hero-copy { padding: clamp(22px, 4vw, 34px); display: grid; gap: 14px; }
.ps-kicker {
  width: fit-content;
  border: 1px solid rgba(45, 212, 191, 0.26);
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.10);
  color: var(--ps-primary-strong);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 7px 11px;
  text-transform: uppercase;
}

.ps-metric-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
}

.ps-metric {
  background: rgba(255,255,255,0.025);
  padding: 22px;
}

.ps-metric span {
  display: block;
  color: var(--ps-subtle);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ps-metric strong {
  display: block;
  margin-top: 6px;
  color: var(--ps-text);
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  letter-spacing: -0.06em;
}

.ps-tabs {
  position: sticky;
  top: 88px;
  z-index: 40;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px;
  border: 1px solid var(--ps-border);
  border-radius: 999px;
  background: rgba(8, 18, 16, 0.86);
  box-shadow: var(--ps-shadow-soft);
  backdrop-filter: blur(18px);
  scrollbar-width: none;
}
.ps-tabs::-webkit-scrollbar { display: none; }

.ps-tab {
  flex: 0 0 auto;
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ps-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  padding: 0 16px;
  white-space: nowrap;
}

.ps-tab[aria-selected="true"] {
  background: linear-gradient(135deg, var(--ps-primary), var(--ps-primary-strong));
  color: var(--ps-primary-ink);
  box-shadow: 0 12px 32px rgba(45, 212, 191, 0.18);
}

.ps-screen { display: grid; gap: 16px; }
.ps-screen-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}
.ps-screen-head h2 { margin: 0; font-size: clamp(1.35rem, 2.4vw, 2.05rem); letter-spacing: -0.04em; }
.ps-screen-head p { max-width: 720px; }

.ps-panel { padding: clamp(16px, 3vw, 24px); }
.ps-panel-soft {
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-md);
  background: rgba(255,255,255,0.03);
  padding: 16px;
}

.ps-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.ps-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ps-grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ps-grid-aside { display: grid; grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.18fr); gap: 16px; align-items: start; }
.ps-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ps-form-stack { display: grid; gap: 12px; }

.ps-card {
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-md);
  background: var(--ps-card);
  box-shadow: 0 16px 44px rgba(0,0,0,0.14);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.ps-card.is-active,
.ps-list-card.is-active {
  border-color: var(--ps-border-strong);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.24), 0 18px 48px rgba(0,0,0,0.2);
}

.ps-card h3,
.ps-card h4,
.ps-panel h3,
.ps-panel h4 { margin: 0; line-height: 1.25; }
.ps-card p { margin: 0; color: var(--ps-muted); }
.ps-meta-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ps-pill {
  width: fit-content;
  border: 1px solid var(--ps-border);
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  color: var(--ps-muted);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 5px 9px;
}
.ps-pill.good { color: var(--ps-success); border-color: rgba(94, 234, 212, 0.28); }
.ps-pill.warn { color: var(--ps-warning); border-color: rgba(251, 191, 36, 0.28); }

.ps-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.ps-button {
  min-height: 44px;
  border: 1px solid var(--ps-border);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: var(--ps-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 900;
  padding: 0 16px;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}
.ps-button:hover { transform: translateY(-1px); border-color: var(--ps-border-strong); }
.ps-button:disabled { cursor: wait; opacity: 0.55; transform: none; }
.ps-button-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--ps-primary), var(--ps-primary-strong));
  color: var(--ps-primary-ink);
  box-shadow: 0 14px 34px rgba(45, 212, 191, 0.18);
}
.ps-button-danger { color: var(--ps-danger); border-color: rgba(251, 113, 133, 0.28); }
.ps-link-button {
  border: 0;
  background: transparent;
  color: var(--ps-primary-strong);
  cursor: pointer;
  font-weight: 900;
  padding: 0;
  text-decoration: underline;
}

.ps-field { display: grid; gap: 7px; }
.ps-field label { color: var(--ps-text); font-size: 0.86rem; font-weight: 900; }
.ps-input,
.ps-select,
.ps-textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm);
  background: rgba(255,255,255,0.045);
  color: var(--ps-text);
  outline: none;
  padding: 11px 13px;
}
.ps-select option { background: #10201d; color: var(--ps-text); }
.ps-textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.ps-input:focus,
.ps-select:focus,
.ps-textarea:focus {
  border-color: var(--ps-primary);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.14);
}
.ps-help { color: var(--ps-muted); font-size: 0.84rem; margin: 0; }

.ps-empty {
  border: 1px dashed var(--ps-border);
  border-radius: var(--ps-radius-md);
  color: var(--ps-muted);
  padding: 22px;
  text-align: center;
}

.ps-table-wrap {
  overflow: auto;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-md);
  background: rgba(255,255,255,0.025);
}
.ps-table { width: 100%; min-width: 680px; border-collapse: collapse; }
.ps-table th,
.ps-table td { border-bottom: 1px solid var(--ps-border); padding: 11px 12px; text-align: left; vertical-align: top; }
.ps-table th { color: var(--ps-subtle); font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase; }
.ps-table tr:last-child td { border-bottom: 0; }

.ps-list-stack { display: grid; gap: 8px; max-height: 460px; overflow: auto; padding-right: 2px; }
.ps-list-card {
  width: 100%;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm);
  background: rgba(255,255,255,0.035);
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 5px;
  padding: 12px;
  text-align: left;
}
.ps-list-card strong { color: var(--ps-text); }
.ps-list-card span { color: var(--ps-muted); font-size: 0.88rem; }

.ps-preview {
  min-height: 220px;
  border: 1px solid var(--ps-border);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(45, 212, 191, 0.08), rgba(255,255,255,0.025)),
    #0b1715;
  padding: 18px;
  display: grid;
  align-content: end;
}
.ps-phone-bubble {
  max-width: 420px;
  border-radius: 20px 20px 4px 20px;
  background: #d9fdd3;
  color: #12322c;
  padding: 13px 14px;
  justify-self: end;
  box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}
.ps-phone-bubble strong { display: block; margin-bottom: 6px; }
.ps-phone-bubble small { display: block; margin-top: 8px; opacity: 0.72; }

.ps-stepper { display: grid; gap: 10px; }
.ps-step {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--ps-muted);
}
.ps-step b {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--ps-card-soft);
  color: var(--ps-primary-strong);
  display: grid;
  place-items: center;
}

.ps-toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(440px, calc(100vw - 44px));
}
.ps-toast {
  border: 1px solid var(--ps-border);
  border-left: 4px solid var(--ps-primary);
  border-radius: var(--ps-radius-md);
  background: rgba(14, 28, 26, 0.96);
  box-shadow: var(--ps-shadow-soft);
  padding: 13px 14px;
}
.ps-toast[data-type="error"] { border-left-color: var(--ps-danger); }
.ps-toast strong { display: block; margin-bottom: 4px; }
.ps-toast p { margin: 0; color: var(--ps-muted); }

.ps-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  color: var(--ps-subtle);
  pointer-events: none;
}
.ps-footer button { pointer-events: auto; }

@media (max-width: 1020px) {
  .ps-hero,
  .ps-grid-aside { grid-template-columns: 1fr; }
  .ps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .ps-container { width: min(100% - 24px, 1220px); }
  .ps-nav { min-height: 68px; }
  .ps-user-chip { display: none; }
  .ps-main { padding-top: 20px; }
  .ps-hero-copy,
  .ps-panel { padding: 16px; }
  .ps-login-grid,
  .ps-metric-board,
  .ps-toolbar,
  .ps-grid,
  .ps-grid-two,
  .ps-form-grid { grid-template-columns: 1fr; }
  .ps-screen-head { display: grid; align-items: start; }
  .ps-tabs { top: 78px; border-radius: var(--ps-radius-md); }
  .ps-tab { min-height: 42px; padding-inline: 13px; }
  .ps-actions .ps-button { width: 100%; }
  .ps-table { min-width: 0; }
  .ps-table thead { display: none; }
  .ps-table,
  .ps-table tbody,
  .ps-table tr,
  .ps-table td { display: block; }
  .ps-table tr { border-bottom: 1px solid var(--ps-border); padding: 10px; }
  .ps-table td { border: 0; padding: 6px 0; }
  .ps-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--ps-subtle);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-lab-app="pesquisas-premium"] *,
  html[data-lab-app="pesquisas-premium"] *::before,
  html[data-lab-app="pesquisas-premium"] *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
