/* ===========================================================
   Pesquisa sobre IA na Educação — estilos
   Tema azul/branco, moderno e minimalista (estilo Google Forms)
   =========================================================== */

:root {
  --azul: #1a73e8;
  --azul-escuro: #1557b0;
  --azul-claro: #e8f0fe;
  --azul-suave: #f1f6ff;
  --cinza-texto: #3c4043;
  --cinza-claro: #5f6368;
  --borda: #dadce0;
  --fundo: #f0f5ff;
  --branco: #ffffff;
  --sucesso: #1e8e3e;
  --erro: #d93025;
  --sombra: 0 1px 3px rgba(60, 64, 67, 0.15), 0 1px 2px rgba(60, 64, 67, 0.1);
  --sombra-md: 0 4px 16px rgba(26, 115, 232, 0.12);
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
  background: linear-gradient(160deg, #e9f1ff 0%, #f6f9ff 40%, #ffffff 100%);
  background-attachment: fixed;
  color: var(--cinza-texto);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

.container-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

/* ---------------------- Cabeçalho / hero ---------------------- */

.hero {
  background: linear-gradient(135deg, var(--azul) 0%, #4285f4 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 40px 32px;
  box-shadow: var(--sombra-md);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  animation: fadeInDown 0.6s ease;
}

.hero::after {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 180px; height: 180px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.hero .icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  margin-bottom: 16px;
  font-size: 28px;
}

.hero h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.25;
}

.hero p { font-size: 15px; opacity: 0.95; max-width: 560px; }

.back-link {
  display: inline-block;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}
.back-link:hover { color: #fff; }

/* ---------------------- Homepage ---------------------- */

.home-hero {
  background: linear-gradient(135deg, var(--azul) 0%, #4285f4 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 56px 40px;
  box-shadow: var(--sombra-md);
  margin-bottom: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: fadeInDown 0.6s ease;
}
.home-hero::before {
  content: "";
  position: absolute;
  bottom: -60px; left: -60px;
  width: 220px; height: 220px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}
.home-hero::after {
  content: "";
  position: absolute;
  top: -50px; right: -50px;
  width: 180px; height: 180px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}
.home-hero .icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px; height: 72px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  margin-bottom: 20px;
  font-size: 38px;
  position: relative;
}
.home-hero h1 { font-size: 30px; font-weight: 700; line-height: 1.25; margin-bottom: 16px; position: relative; }
.home-hero .lead { font-size: 16px; opacity: 0.96; max-width: 600px; margin: 0 auto 28px; position: relative; }
.home-hero .hero-sub { font-size: 13px; opacity: 0.85; margin-top: 16px; position: relative; }

.btn-light {
  background: #fff;
  color: var(--azul);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  position: relative;
}
.btn-light:hover { background: var(--azul-suave); transform: translateY(-2px); text-decoration: none; }
.btn-lg-pill { font-size: 17px; padding: 16px 34px; border-radius: 50px; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.info-card {
  background: #fff;
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  padding: 26px 22px;
  text-align: center;
  box-shadow: var(--sombra);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: fadeInUp 0.5s ease both;
}
.info-card:hover { transform: translateY(-4px); box-shadow: var(--sombra-md); }
.info-card .info-icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  background: var(--azul-claro);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.info-card h3 { font-size: 17px; color: var(--azul); margin-bottom: 6px; }
.info-card p { font-size: 14px; color: var(--cinza-claro); }

.about-card h2 { font-size: 20px; margin-bottom: 14px; color: var(--cinza-texto); }
.about-card p { font-size: 15px; color: var(--cinza-texto); }
.about-card .btn { width: 100%; }

/* ---------------------- Cartões de pergunta ---------------------- */

.card {
  background: var(--branco);
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--sombra);
  border-left: 5px solid transparent;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
  animation: fadeInUp 0.5s ease both;
}

.card:focus-within {
  border-left-color: var(--azul);
  box-shadow: var(--sombra-md);
}

.card .question {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 16px;
  font-weight: 600;
  color: var(--cinza-texto);
  margin-bottom: 14px;
}

.card .q-number {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px; height: 26px;
  background: var(--azul-claro);
  color: var(--azul);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.req { color: var(--erro); margin-left: 2px; }

/* ---------------------- Inputs ---------------------- */

label.field-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--cinza-texto);
}

input[type="text"],
input[type="number"],
input[type="password"],
textarea,
select {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--cinza-texto);
  background: var(--azul-suave);
  border: 1.5px solid var(--borda);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

textarea { min-height: 96px; resize: vertical; }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--azul);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.12);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%231a73e8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  cursor: pointer;
}

/* Opções de frequência como "chips" de rádio */
.radio-group { display: flex; flex-direction: column; gap: 8px; }

.radio-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--borda);
  border-radius: 10px;
  cursor: pointer;
  background: var(--azul-suave);
  transition: border-color 0.2s, background 0.2s;
}

.radio-option:hover { border-color: #b9d3fb; }
.radio-option input { width: 18px; height: 18px; accent-color: var(--azul); cursor: pointer; }
.radio-option.selected { border-color: var(--azul); background: var(--azul-claro); }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr 120px;
  gap: 16px;
}

/* ---------------------- Botões ---------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 13px 24px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

.btn-primary {
  background: var(--azul);
  color: #fff;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.35);
}
.btn-primary:hover { background: var(--azul-escuro); box-shadow: 0 4px 14px rgba(26, 115, 232, 0.45); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-lg { width: 100%; font-size: 16px; padding: 16px; }

.btn-secondary {
  background: #fff;
  color: var(--azul);
  border: 1.5px solid var(--borda);
}
.btn-secondary:hover { background: var(--azul-suave); border-color: var(--azul); }

.btn-danger { background: #fff; color: var(--erro); border: 1.5px solid #f3c2bd; padding: 7px 12px; font-size: 13px; }
.btn-danger:hover { background: #fdecea; }

.btn-ghost { background: transparent; color: var(--cinza-claro); border: 1.5px solid var(--borda); }
.btn-ghost:hover { background: #f1f3f4; }

.actions { margin-top: 8px; }

/* ---------------------- Mensagens ---------------------- */

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}
.alert.show { display: block; animation: fadeInUp 0.3s ease; }
.alert-error { background: #fce8e6; color: var(--erro); border: 1px solid #f3c2bd; }
.alert-success { background: #e6f4ea; color: var(--sucesso); border: 1px solid #b7dfc1; }

/* Tela de sucesso */
.success-screen {
  background: #fff;
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
  box-shadow: var(--sombra-md);
  animation: fadeInUp 0.5s ease;
}
.success-screen .check {
  width: 80px; height: 80px;
  margin: 0 auto 20px;
  background: #e6f4ea;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  animation: pop 0.5s ease;
}
.success-screen h2 { color: var(--sucesso); font-size: 24px; margin-bottom: 8px; }
.success-screen p { color: var(--cinza-claro); margin-bottom: 24px; }

.footer-note {
  text-align: center;
  font-size: 13px;
  color: var(--cinza-claro);
  margin-top: 24px;
}

/* ---------------------- Login ---------------------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--sombra-md);
  padding: 40px 32px;
  width: 100%;
  max-width: 400px;
  animation: fadeInUp 0.5s ease;
}
.login-card .icon-badge {
  width: 60px; height: 60px;
  background: var(--azul-claro);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  margin: 0 auto 16px;
}
.login-card h1 { text-align: center; font-size: 22px; margin-bottom: 4px; }
.login-card .subtitle { text-align: center; color: var(--cinza-claro); font-size: 14px; margin-bottom: 24px; }
.login-card .form-group { margin-bottom: 16px; }

/* ---------------------- Painel administrativo ---------------------- */

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--borda);
  box-shadow: var(--sombra);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--azul); }
.topbar .brand .logo {
  width: 36px; height: 36px; background: var(--azul); color: #fff;
  border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px;
}

.tabs { display: flex; gap: 8px; margin: 24px 0; flex-wrap: wrap; }
.tab {
  padding: 10px 18px;
  border-radius: 10px;
  background: #fff;
  border: 1.5px solid var(--borda);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--cinza-claro);
  display: flex; align-items: center; gap: 8px;
  transition: all 0.2s;
}
.tab.active { background: var(--azul); color: #fff; border-color: var(--azul); }
.tab:hover:not(.active) { background: var(--azul-suave); }

.panel { display: none; animation: fadeInUp 0.4s ease; }
.panel.active { display: block; }

/* Cartões de estatística */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--sombra);
  border-left: 5px solid var(--azul);
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--sombra-md); }
.stat-card .stat-label { font-size: 13px; color: var(--cinza-claro); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .stat-value { font-size: 34px; font-weight: 700; color: var(--azul); margin-top: 6px; }
.stat-card .stat-icon { float: right; font-size: 26px; opacity: 0.85; }

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.chart-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--sombra);
}
.chart-card h3 { font-size: 15px; margin-bottom: 16px; color: var(--cinza-texto); display: flex; align-items: center; gap: 8px; }
.chart-card .chart-box { position: relative; height: 280px; }

/* Barra de busca / ações */
.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.search-box { flex: 1; min-width: 220px; position: relative; }
.search-box input { padding-left: 40px; }
.search-box .search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--cinza-claro); }

/* Tabela */
.table-wrap {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--sombra);
  overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  background: var(--azul-suave);
  color: var(--cinza-texto);
  text-align: left;
  padding: 14px 12px;
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 2px solid var(--borda);
  position: sticky; top: 0;
}
tbody td { padding: 12px; border-bottom: 1px solid #eef1f4; vertical-align: top; max-width: 280px; }
tbody tr:hover { background: var(--azul-suave); }
.badge {
  display: inline-block;
  background: var(--azul-claro);
  color: var(--azul);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.empty-state { text-align: center; padding: 48px 16px; color: var(--cinza-claro); }
.empty-state .big-icon { font-size: 48px; opacity: 0.5; margin-bottom: 12px; }

.muted { color: var(--cinza-claro); font-size: 13px; }
.cell-text { white-space: pre-wrap; word-break: break-word; }

/* Detalhes (linha expandida) */
details summary { cursor: pointer; color: var(--azul); font-weight: 600; font-size: 13px; }
details[open] summary { margin-bottom: 6px; }

/* ---------------------- Animações ---------------------- */

@keyframes fadeInUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.1); } 100% { transform: scale(1); } }

.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------- Responsivo ---------------------- */

@media (max-width: 640px) {
  .hero { padding: 28px 22px; }
  .hero h1 { font-size: 22px; }
  .card { padding: 18px; }
  .field-row { grid-template-columns: 1fr; }
  .stat-card .stat-value { font-size: 28px; }
  .topbar-inner { flex-wrap: wrap; }
}
