@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #1e1040;
  background: #f0ebfa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, #ddd0ff 0%, #f0ebfa 60%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 0 24px;
}

/* ─── Shell ─────────────────────────────────────── */
.page-shell {
  width: min(660px, calc(100% - 32px));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─── Hero ───────────────────────────────────────── */
.hero-card {
  background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 55%, #9333ea 100%);
  color: #fff;
  padding: 28px 28px 24px;
  border-radius: 20px;
  box-shadow: 0 20px 48px rgba(91, 33, 182, 0.30), 0 1px 0 rgba(255,255,255,0.08) inset;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 10%, rgba(255,255,255,0.10) 0%, transparent 60%);
  pointer-events: none;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.hero-icon {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.hero-company {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.70);
}

.hero-title {
  margin: 0 0 6px;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.hero-sub {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.70);
  line-height: 1.55;
}

/* ─── Top row: CPF + Dados ──────────────────────── */
.top-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.top-row.user-hidden {
  grid-template-columns: 1fr;
}

.top-row.user-hidden .search-card {
  grid-column: 1 / -1;
}

.search-card,
.user-card {
  background: #fff;
  border: 1px solid #e4d8ff;
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 4px 18px rgba(99, 53, 200, 0.07);
}

.search-card label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7c3aed;
}

.search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

input {
  flex: 1;
  min-height: 42px;
  border: 1.5px solid #e4d8ff;
  border-radius: 10px;
  padding: 0 13px;
  font-size: 0.93rem;
  font-family: inherit;
  background: #faf6ff;
  color: #1e1040;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input::placeholder {
  color: #bba8dc;
}

input:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.13);
}

button {
  min-width: 92px;
  min-height: 42px;
  border: none;
  border-radius: 10px;
  background: #7c3aed;
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.13s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.28);
}

button:hover {
  background: #6d28d9;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.36);
}

button:active {
  transform: translateY(0);
}

/* ─── User card ──────────────────────────────────── */
.card-label {
  margin: 0 0 10px;
  font-size: 0.70rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7c3aed;
}

.user-name {
  margin: 0 0 4px;
  font-size: 0.98rem;
  font-weight: 700;
  color: #1e1040;
  line-height: 1.3;
}

.user-detail {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: #5c4a8a;
  line-height: 1.5;
}

.user-email {
  color: #7c3aed;
  font-size: 0.83rem;
  word-break: break-all;
}

/* ─── Result card ────────────────────────────────── */
.result-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─── Stats card ─────────────────────────────────── */
.stats-card {
  background: #fff;
  border: 1px solid #e4d8ff;
  border-radius: 16px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  box-shadow: 0 4px 18px rgba(99, 53, 200, 0.07);
}

.stats-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid #f0eaff;
  padding-right: 20px;
}

.summary-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.summary-header h2 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  color: #1e1040;
}

.status-pill {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.12);
  color: #5b21b6;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.summary-message {
  margin: 0;
  font-size: 0.85rem;
  color: #5c4a8a;
  line-height: 1.55;
}

.action-box {
  margin-top: 10px;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid rgba(124, 58, 237, 0.18);
  background: #f7f2ff;
  font-size: 0.85rem;
  color: #4b2a8f;
  line-height: 1.5;
}

.action-box p {
  margin: 0 0 8px;
}

.action-box p:only-child {
  margin: 0;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.action-buttons button {
  width: 100%;
  font-size: 0.85rem;
}

/* ─── Steps (direita do stats) ───────────────────── */
.stats-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

.step-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 4px;
  border-bottom: 1px solid #f2edff;
}

.step-inline:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.step-inline:first-child {
  padding-top: 0;
}

.step-label {
  flex: 1;
  font-size: 0.90rem;
  font-weight: 600;
  color: #2d1b5e;
}

.step-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: #7c6ba0;
}

.step-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #c4b5fd;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: background 0.2s;
}

.step-text {
  font-size: 0.82rem;
  color: #5c4a8a;
  margin: 0;
}

.step-card {
  padding: 10px 12px;
  border-radius: 10px;
  background: #faf6ff;
  border: 1px solid #e4d8ff;
}

.step-card .step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.step-title {
  font-weight: 700;
  color: #2d1b5e;
  font-size: 0.88rem;
}

.step-detail {
  font-size: 0.80rem;
  color: #6b5496;
  margin-top: 4px;
  display: none;
}

/* ─── Botão Emitir ───────────────────────────────── */
.certificate-card {
  width: 100%;
}

.certificate-card button {
  width: 100%;
  min-height: 48px;
  border-radius: 13px;
  font-size: 0.96rem;
  font-weight: 700;
  background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 60%, #9333ea 100%);
  box-shadow: 0 10px 28px rgba(91, 33, 182, 0.30);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.01em;
}

.certificate-card button:hover {
  background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 60%, #7e22ce 100%);
  box-shadow: 0 14px 34px rgba(91, 33, 182, 0.38);
}

.certificate-card.hidden {
  display: none !important;
}

.support-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border: 1px solid #d8c9f7;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
  color: #5c4a8a;
  font-size: 0.80rem;
  line-height: 1.5;
}

.support-card p {
  margin: 0;
}

.support-card a {
  color: #6d28d9;
  font-weight: 700;
  text-decoration: none;
}

.support-card a:hover {
  text-decoration: underline;
}

.support-icon {
  width: 24px;
  height: 24px;
  border: 1px solid #c4b5fd;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #6d28d9;
  font-size: 0.78rem;
  font-weight: 800;
}

/* ─── Utilitários ────────────────────────────────── */
.hidden {
  display: none !important;
}

/* ─── Snackbar ───────────────────────────────────── */
.snackbar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 12px;
  background: #3b1f7a;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 14px 32px rgba(59, 31, 122, 0.32);
  opacity: 0;
  transition: opacity 0.22s ease;
  z-index: 50;
  white-space: nowrap;
  pointer-events: none;
}

.snackbar.show {
  opacity: 1;
}

/* ─── Responsivo ─────────────────────────────────── */
@media (max-width: 560px) {
  body {
    align-items: flex-start;
    padding: 24px 0 40px;
  }

  .top-row,
  .stats-card {
    grid-template-columns: 1fr;
  }

  .stats-left {
    border-right: none;
    border-bottom: 1px solid #f0eaff;
    padding-right: 0;
    padding-bottom: 14px;
  }

  .search-row {
    flex-wrap: wrap;
  }

  button,
  input {
    width: 100%;
  }
}
