:root {
  --navy:    #1B2F52;
  --gold:    #C9A84C;
  --bg:      #F4F1EC;
  --white:   #FFFFFF;
  --border:  #E2DDD6;
  --text:    #1D1D1D;
  --muted:   #7A7A7A;
  --erro:    #c0392b;
  --radius:  10px;
  --shadow:  0 1px 4px rgba(27,47,82,0.08);
}

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

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

.state { display: none; }
.state.active { display: block; }

/* ── LAYOUT ── */
.page-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.page-container.centered {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.page-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--gold);
}

.page-title {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  color: var(--navy);
  font-weight: 700;
}

.page-subtitle {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 3px;
}

.content-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── CARD ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card-title {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  color: var(--navy);
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── FORM ── */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--navy);
  margin-bottom: 5px;
}

input[type="text"],
input[type="email"],
select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.12);
}

/* ── DROP ZONE ── */
.drop-zone {
  display: block;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.drop-zone:hover, .drop-zone.dragging {
  border-color: var(--gold);
  background: #faf7f0;
}

.drop-icon { font-size: 2rem; margin-bottom: 6px; }

.drop-text {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.drop-link { color: var(--gold); font-weight: 600; cursor: pointer; }
.drop-hint { font-size: 0.72rem; color: #aaa; }

.file-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f0f7f0;
  border: 1.5px solid #27ae60;
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 8px;
  font-size: 0.85rem;
}

.file-selected button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--erro);
  font-size: 1rem;
  font-weight: 700;
}

/* ── BUTTONS ── */
.btn-primary {
  width: 100%;
  padding: 11px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  margin-top: 4px;
}

.btn-primary:hover:not(:disabled) { background: #243d6b; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-outline {
  width: 100%;
  padding: 10px;
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
  border-radius: 6px;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 10px;
}

.btn-outline:hover { background: var(--bg); }

/* ── PROCESSING ── */
.processing-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
  box-shadow: var(--shadow);
  max-width: 440px;
  width: 100%;
}

.logo-processing {
  height: 64px;
  width: auto;
  object-fit: contain;
  margin-bottom: 20px;
}

.processing-title {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--navy);
  margin-bottom: 20px;
}

.progress-bar-wrap {
  width: 100%;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-message {
  font-size: 0.85rem;
  color: var(--navy);
  font-weight: 500;
  min-height: 1.4em;
  margin-bottom: 8px;
}

.processing-hint { font-size: 0.72rem; color: var(--muted); }

/* ── RESULT ── */
.result-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  background: var(--navy);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.result-score-box { text-align: center; }

.result-score {
  font-family: 'Cinzel', serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.result-score-label {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

.result-conceito {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  color: var(--white);
  font-weight: 700;
  margin-bottom: 4px;
}

.result-prontidao { font-size: 0.82rem; color: var(--gold); margin-bottom: 3px; }
.result-category  { font-size: 0.78rem; color: rgba(255,255,255,0.65); margin-bottom: 2px; }
.result-pages     { font-size: 0.78rem; color: rgba(255,255,255,0.5); }

.result-price-box { text-align: right; }
.result-price-label {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.result-price {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--gold);
  font-weight: 700;
}

.result-actions { display: flex; flex-direction: column; gap: 0; }

/* ── HISTÓRICO ── */
.historico-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.historico-table th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}

.historico-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.historico-table tr:last-child td { border-bottom: none; }
.historico-table tr:hover td { background: #faf7f0; }

.score-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.78rem;
  background: var(--navy);
  color: var(--gold);
}

.btn-download {
  padding: 5px 12px;
  border-radius: 5px;
  border: 1.5px solid var(--navy);
  background: transparent;
  color: var(--navy);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s;
}

.btn-download:hover { background: var(--bg); }

.empty-msg { color: var(--muted); font-size: 0.85rem; text-align: center; padding: 20px 0; }

/* ── MISC ── */
.hidden { display: none !important; }

.error-msg {
  color: var(--erro);
  font-size: 0.82rem;
  margin-top: 10px;
  text-align: center;
}

.rejection-notice {
  background: #fdf0f0;
  border: 1px solid #e8b4b4;
  border-left: 4px solid var(--erro);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 12px;
  color: #7b1d1d;
}
.rejection-notice strong { display: block; font-size: 0.9rem; margin-bottom: 4px; }
.rejection-notice p { font-size: 0.82rem; line-height: 1.5; margin: 0; }

@media (max-width: 600px) {
  .form-row-2 { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; text-align: center; }
  .result-price-box { text-align: center; }
  .historico-table th:nth-child(2),
  .historico-table td:nth-child(2) { display: none; }
}
