/* ============================================================
   Sorteio de Kits · Desafio -5kg em 7 Dias · Carol Zonato
   Identidade visual: verde-floresta / terracota / dourado / creme
   ============================================================ */

:root {
  --verde-floresta: #083F2C;
  --verde-floresta-escuro: #052a1d;
  --terracota: #C17F5A;
  --terracota-escuro: #a8663f;
  --dourado: #E8A87C;
  --creme: #FDF8F3;
  --marrom: #2C1A0E;

  --font-title: 'Lora', serif;
  --font-body: 'Poppins', sans-serif;

  --radius: 16px;
  --shadow-soft: 0 8px 24px rgba(44, 26, 14, 0.08);
  --shadow-card: 0 12px 32px rgba(8, 63, 44, 0.12);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--creme);
  color: var(--marrom);
  font-family: var(--font-body);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, .font-title {
  font-family: var(--font-title);
}

/* ===================== HEADER ===================== */

.site-header {
  background: var(--verde-floresta);
  background: linear-gradient(160deg, var(--verde-floresta) 0%, var(--verde-floresta-escuro) 100%);
  padding: 28px 20px;
  text-align: center;
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.logo {
  max-width: 230px;
  width: 100%;
  height: auto;
}

.logo-placeholder {
  background: rgba(232, 168, 124, 0.15);
  border: 1px dashed var(--dourado);
  color: var(--creme);
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 0.9rem;
  max-width: 480px;
}

.logo-placeholder code {
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.82rem;
}

.header-tagline {
  color: var(--dourado);
  font-family: var(--font-title);
  font-style: italic;
  font-size: 1.05rem;
  margin: 4px 0 0;
}

/* ===================== LAYOUT ===================== */

.container {
  flex: 1;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 18px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 26px 22px;
}

.step-title {
  color: var(--verde-floresta);
  font-size: 1.4rem;
  margin: 0 0 6px;
}

.step-subtitle {
  margin: 0 0 20px;
  color: #5a4736;
  font-size: 0.96rem;
}

/* ===================== TABS ===================== */

.input-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.tab-btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1.5px solid #e6d9cc;
  background: var(--creme);
  color: var(--marrom);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  border-color: var(--terracota);
}

.tab-btn.active {
  background: var(--verde-floresta);
  border-color: var(--verde-floresta);
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ===================== FORM ELEMENTS ===================== */

.field-label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 8px;
  color: var(--marrom);
}

.input-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.text-input {
  flex: 1;
  min-width: 200px;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1.5px solid #e6d9cc;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--creme);
  color: var(--marrom);
}

.text-input:focus {
  outline: none;
  border-color: var(--terracota);
}

.file-drop {
  border: 2px dashed #d9c3ac;
  border-radius: 14px;
  padding: 28px 18px;
  text-align: center;
  background: var(--creme);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.file-drop:hover, .file-drop.drag-over {
  border-color: var(--terracota);
  background: #fbeee2;
}

.file-drop-link {
  color: var(--terracota-escuro);
  font-weight: 600;
  text-decoration: underline;
}

.file-drop-name {
  margin: 10px 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--verde-floresta);
}

/* ===================== BUTTONS ===================== */

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 22px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

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

.btn-primary {
  background: var(--terracota);
  color: #fff;
  box-shadow: 0 6px 16px rgba(193, 127, 90, 0.35);
}

.btn-primary:hover:not(:disabled) {
  background: var(--terracota-escuro);
}

.btn-secondary {
  background: var(--verde-floresta);
  color: #fff;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--verde-floresta-escuro);
}

.btn-large {
  width: 100%;
  padding: 16px 22px;
  font-size: 1.05rem;
  margin-top: 8px;
}

/* ===================== LOADING / ERROR ===================== */

.loading-indicator {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--verde-floresta);
  font-weight: 600;
  font-size: 0.92rem;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid #e6d9cc;
  border-top-color: var(--terracota);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-box {
  margin-top: 16px;
  background: #fdeee7;
  border: 1.5px solid var(--dourado);
  color: #8a4a2a;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ===================== PREVIEW ===================== */

.participants-count {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--verde-floresta);
  background: #eef6f1;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 18px;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #eee0d2;
  margin-bottom: 8px;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 480px;
}

.preview-table th {
  background: var(--verde-floresta);
  color: #fff;
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  position: sticky;
  top: 0;
}

.preview-table td {
  padding: 9px 14px;
  border-top: 1px solid #f1e6d8;
}

.preview-table tbody tr:nth-child(even) {
  background: #fbf7f1;
}

.preview-note {
  font-size: 0.82rem;
  color: #8a765f;
  margin: 6px 0 18px;
  font-style: italic;
}

.draw-options {
  margin-bottom: 6px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--marrom);
  cursor: pointer;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--terracota);
}

/* ===================== DRAW STAGE / ANIMATION ===================== */

.draw-stage {
  text-align: center;
  position: relative;
  overflow: hidden;
}

.slot-machine {
  position: relative;
  margin: 26px auto 12px;
  max-width: 420px;
}

.slot-window {
  background: var(--verde-floresta);
  border: 4px solid var(--dourado);
  border-radius: 18px;
  padding: 30px 20px;
  box-shadow: inset 0 0 24px rgba(0,0,0,0.35), 0 10px 28px rgba(8,63,44,0.25);
  overflow: hidden;
}

.slot-name {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.6rem;
  color: #fff;
  letter-spacing: 0.5px;
}

.countdown {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--terracota-escuro);
  font-weight: 600;
  min-height: 1.6em;
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999;
}

/* ===================== RESULT ===================== */

.result-card {
  text-align: center;
  background: var(--creme);
  border: 2px solid var(--dourado);
  animation: resultPop 0.5s ease;
}

@keyframes resultPop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.result-kicker {
  color: var(--terracota-escuro);
  font-weight: 600;
  margin: 0 0 6px;
}

.result-title {
  font-family: var(--font-title);
  font-size: 2rem;
  color: var(--verde-floresta);
  margin: 0 0 22px;
  text-shadow: 0 0 18px rgba(232, 168, 124, 0.5);
}

.result-details {
  background: #fff;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 22px;
  text-align: left;
}

.result-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f1e6d8;
  flex-wrap: wrap;
}

.result-row:last-child {
  border-bottom: none;
}

.result-label {
  font-weight: 600;
  color: #8a765f;
  font-size: 0.85rem;
}

.result-value {
  font-weight: 600;
  color: var(--marrom);
  text-align: right;
}

.result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.copy-feedback {
  margin-top: 12px;
  color: var(--verde-floresta);
  font-weight: 600;
  font-size: 0.88rem;
}

.empty-pool-msg {
  margin-top: 16px;
  background: #fdeee7;
  border: 1.5px solid var(--dourado);
  color: #8a4a2a;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 500;
}

.winners-history-title {
  margin: 26px 0 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--terracota-escuro);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.winners-history {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
  font-size: 0.88rem;
  color: #5a4736;
}

.winners-history li {
  padding: 6px 0;
  border-bottom: 1px dashed #e6d9cc;
}

/* ===================== FOOTER ===================== */

.site-footer {
  background: var(--dourado);
  color: var(--marrom);
  text-align: center;
  padding: 16px;
  font-weight: 600;
  font-size: 0.88rem;
}

/* ===================== RESPONSIVE ===================== */

@media (max-width: 480px) {
  .card {
    padding: 20px 16px;
  }

  .step-title {
    font-size: 1.2rem;
  }

  .result-title {
    font-size: 1.6rem;
  }

  .input-row {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .result-actions .btn {
    width: 100%;
  }
}
