:root {
  --bg: #252423;
  --bg-deep: #1a1918;
  --surface: #2e2d2c;
  --surface-hover: #363534;
  --border: #3d3c3a;
  --border-strong: #4a4947;
  --text: #f2f2f1;
  --text-muted: #a3a29f;
  --text-dim: #6f6e6b;
  --blue: #4d9bfe;
  --cyan: #06c7d4;
  --danger: #ff6b6b;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

html { background: var(--bg-deep); }

body {
  background: radial-gradient(ellipse at top, #2c2b2a 0%, var(--bg) 45%, var(--bg-deep) 100%) fixed;
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--text); }

/* ── Quadradinhos decorativos ── */
#squares {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.deco-square {
  position: absolute;
  border-radius: 3px;
  opacity: 0;
}

.deco-square.outline {
  background: transparent !important;
  border: 1.5px solid currentColor;
}

/* ── Login ── */
.auth-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.auth-card {
  width: 100%;
  max-width: 512px;
  text-align: center;
  opacity: 0;
}

/* Logo: grade 2x2 — 2 quadrados na 1ª coluna, 1 na linha 1 da 2ª coluna */
.logo {
  --sq: 15px;
  --gap: 4px;
  width: 56px;
  height: 56px;
  margin: 0 auto 24px;
  border-radius: 14px;
  /* background: #121212; */
  /* border: 1px solid var(--border); */
  display: grid;
  grid-template-columns: repeat(2, var(--sq));
  grid-template-rows: repeat(2, var(--sq));
  gap: var(--gap);
  place-content: center;
  /* box-shadow: 0 0 24px rgba(77, 155, 254, 0.15); */
}

.logo span {
  border-radius: 2px;
  background: var(--blue);
  box-shadow: 0 0 6px rgba(77, 155, 254, 0.5);
}

.logo span:nth-child(1) { grid-column: 1; grid-row: 1; }
.logo span:nth-child(2) { grid-column: 1; grid-row: 2; }
.logo span:nth-child(3) { grid-column: 2; grid-row: 1; }

/* Xadrez azul/ciano, igual à animação de abertura */
.logo span:nth-child(2),
.logo span:nth-child(3) {
  background: var(--cyan);
  box-shadow: 0 0 6px rgba(6, 199, 212, 0.5);
}

.auth-card h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 28px;
}

.subtitle strong { color: var(--text); font-weight: 600; }

.btn {
  width: 100%;
  height: 46px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  position: relative;
}

.btn:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #0b1422;
}

.btn-primary:hover:not(:disabled) {
  background: #66aaff;
  border-color: #66aaff;
}

.btn-primary:disabled {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-dim);
  opacity: 1;
}

.badge {
  position: absolute;
  top: -10px;
  right: 10px;
  background: #3a3937;
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 13px;
  margin: 28px 0 22px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.field {
  text-align: left;
  margin-bottom: 28px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.field input {
  width: 100%;
  height: 48px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: #2a2928;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  padding: 0 16px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input::placeholder { color: var(--text-dim); }

.field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(77, 155, 254, 0.2);
}

.field input.code-input {
  text-align: center;
  font-size: 24px;
  letter-spacing: 10px;
  font-variant-numeric: tabular-nums;
}

.hint {
  color: var(--text-muted);
  font-size: 13px;
  margin: -12px 0 24px;
  text-align: left;
}

.link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 16px;
}

.link-btn:hover { color: var(--text); }

.message {
  font-size: 13px;
  min-height: 18px;
  margin: 14px 0 0;
  color: var(--danger);
}

.message.ok { color: var(--cyan); }

.legal {
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 36px;
}

.legal a { color: var(--text-muted); }

/* ── App principal ── */
.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  opacity: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(37, 36, 35, 0.7);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

.brand .logo {
  --sq: 10px;
  --gap: 3px;
  width: 36px;
  height: 36px;
  margin: 0;
  border-radius: 9px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--text-muted);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #0b1422;
  font-weight: 700;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }

.btn-sm {
  width: auto;
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
}

.main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 28px;
}

.main .hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.main .hero h1 .accent {
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.main .hero p {
  color: var(--text-muted);
  font-size: 16px;
  margin: 0 0 40px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  background: rgba(46, 45, 44, 0.75);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.card .card-icon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--blue);
  box-shadow: 0 0 12px var(--blue);
  margin-bottom: 16px;
}

.card:nth-child(even) .card-icon {
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.card h3 { margin: 0 0 6px; font-size: 16px; }

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

.card .value { font-size: 28px; font-weight: 700; margin-top: 4px; }

@media (max-width: 560px) {
  .topbar { padding: 12px 16px; }
  .user-menu .email { display: none; }
  .main { padding: 36px 16px; }
}
