:root {
  --primary: #1e3a8a;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #2563eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --dark: #0f172a;
  --gray-900: #1e293b;
  --gray-700: #334155;
  --gray-500: #64748b;
  --gray-300: #cbd5e1;
  --gray-100: #f1f5f9;
  --gray-50: #f8fafc;
  --white: #ffffff;
  --radius: 12px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-title: 'Outfit', sans-serif;
}

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

body {
  font-family: var(--font-main);
  background-color: #f3f4f6;
  color: var(--gray-900);
  line-height: 1.5;
  padding-bottom: 60px;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

/* NAVBAR */
.navbar {
  background: #0d1e67;
  color: var(--white);
  padding: 16px 0;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #0d1e67;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.5px;
  color: var(--white);
}

.logo-subtitle {
  font-size: 12px;
  color: #93c5fd;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-outline-debug {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-outline-debug:hover {
  background: rgba(255, 255, 255, 0.2);
}

.badge {
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.btn-config {
  background: #2563eb;
  color: var(--white);
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-config:hover {
  background: #1d4ed8;
}

/* HERO BANNER */
.hero-banner {
  background: linear-gradient(135deg, #0d1e67 0%, #1e3a8a 100%);
  color: var(--white);
  padding: 40px 0 50px 0;
  text-align: center;
  position: relative;
}

.banner-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  color: #bfdbfe;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}

.hero-banner h1 {
  font-family: var(--font-title);
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 10px;
}

.hero-banner p {
  color: #cbd5e1;
  max-width: 600px;
  margin: 0 auto;
  font-size: 15px;
}

/* MAIN CONTENT */
.main-content {
  margin-top: -30px;
  position: relative;
  z-index: 10;
}

/* REGRAS CARD */
.rules-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  border: 1px solid #e2e8f0;
}

.rules-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-100);
}

.rules-header i {
  font-size: 20px;
}

.rules-header h3 {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--gray-700);
  background: var(--gray-50);
  padding: 10px 14px;
  border-radius: 8px;
}

.rule-item i {
  color: var(--success);
  margin-top: 3px;
  font-size: 14px;
}

.highlight-rule {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.highlight-rule i {
  color: #2563eb;
}

/* API STATUS BANNER */
.api-status-banner {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.mode-simulation {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.mode-real {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.status-icon {
  font-size: 24px;
}

.status-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.status-info strong {
  font-size: 15px;
  margin-bottom: 2px;
}

.status-info span {
  font-size: 13px;
  opacity: 0.9;
}

.btn-xs {
  background: var(--gray-900);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* FORMULARIO */
.voting-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-md);
  border: 1px solid #e2e8f0;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--gray-100);
}

.section-number {
  background: var(--primary);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 16px;
}

.section-header h2 {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-group label i {
  color: var(--primary);
}

.form-group input,
.form-group select {
  padding: 12px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font-main);
  transition: all 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.help-text {
  font-size: 12px;
  color: var(--gray-500);
}

/* CATEGORIAS */
.categories-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.category-card {
  background: var(--gray-50);
  border-radius: 10px;
  padding: 18px;
  border: 1px solid var(--gray-300);
}

.category-title {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.option-card {
  cursor: pointer;
  display: block;
}

.option-card input[type="radio"] {
  display: none;
}

.option-content {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid var(--gray-300);
  transition: all 0.2s;
}

.option-card:hover .option-content {
  border-color: #93c5fd;
}

.radio-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--gray-400);
  border-radius: 50%;
  display: inline-block;
  position: relative;
  transition: all 0.2s;
}

.option-card input[type="radio"]:checked + .option-content {
  border-color: var(--accent);
  background: #eff6ff;
}

.option-card input[type="radio"]:checked + .option-content .radio-custom {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--white);
}

.option-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
}

/* PAINEL DE TESTE DIRETO DE SMS TOKEN */
.sms-tester-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 10px 25px -5px rgba(30, 58, 138, 0.12);
  margin-bottom: 30px;
  border: 2px solid #bfdbfe;
}

.sms-tester-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--gray-100);
}

.sms-tester-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sms-tester-title i {
  font-size: 28px;
  color: var(--accent);
}

.sms-tester-title h3 {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
}

.sms-tester-title p {
  font-size: 13px;
  color: var(--gray-500);
}

.btn-outline-dark {
  background: var(--gray-900);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sms-tester-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.tester-step-box {
  background: var(--gray-50);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--gray-300);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.tester-step-badge {
  display: inline-block;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  align-self: flex-start;
}

.tester-step-box h4 {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
}

.btn-action-primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-action-primary:hover {
  background: var(--primary-hover);
}

.btn-action-success {
  background: var(--success);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-action-success:hover {
  background: #059669;
}

.tester-feedback {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 4px;
}

.tester-feedback.success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.tester-feedback.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.form-actions {
  text-align: center;
  margin-top: 10px;
}

.btn-primary-lg {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
  color: white;
  border: none;
  padding: 18px 36px;
  border-radius: 12px;
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(30, 58, 138, 0.35);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-primary-lg:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 58, 138, 0.45);
}

/* ESTATISTICAS */
.stats-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-md);
  margin-top: 36px;
  border: 1px solid #e2e8f0;
}

.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gray-100);
}

.stats-header h2 {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 700;
}

.btn-sm {
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

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

.stat-box {
  background: var(--gray-50);
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--gray-200);
}

.stat-box h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}

.empty-stats {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--gray-500);
  padding: 30px;
  font-size: 14px;
}

/* MODAIS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-card {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.2);
  position: relative;
  overflow: hidden;
}

.modal-lg {
  max-width: 640px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--gray-500);
  cursor: pointer;
}

.modal-header {
  padding: 24px 24px 16px 24px;
}

.modal-header h3 {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 800;
  color: var(--dark);
}

.modal-header p {
  font-size: 13.5px;
  color: var(--gray-500);
  margin-top: 4px;
}

.modal-icon-bubble {
  width: 56px;
  height: 56px;
  background: #eff6ff;
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 12px auto;
}

.phone-highlight {
  display: inline-block;
  background: #f1f5f9;
  border: 1px dashed var(--accent);
  color: var(--primary);
  font-family: monospace;
  font-size: 16px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  margin-top: 8px;
}

.modal-body {
  padding: 0 24px 24px 24px;
}

.simulated-code-box {
  background: #fef3c7;
  border: 1.5px dashed #f59e0b;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  margin-bottom: 20px;
}

.sim-badge {
  font-size: 11px;
  font-weight: 800;
  color: #b45309;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.simulated-code-box p {
  font-size: 12px;
  color: #78350f;
  margin-bottom: 6px;
}

.sim-code-digits {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 4px;
  color: #b45309;
}

.otp-input-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  margin-bottom: 16px;
}

.otp-input-container label {
  font-size: 13.5px;
  font-weight: 600;
}

.otp-input-container input {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 12px;
  text-align: center;
  padding: 12px;
  border: 2px solid var(--accent);
  border-radius: 10px;
  outline: none;
}

.sms-status-msg {
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
  margin-bottom: 14px;
}

.sms-status-msg.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.sms-status-msg.success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.timer-area {
  text-align: center;
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-primary-block {
  width: 100%;
  background: var(--accent);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary-block:hover {
  background: var(--primary-hover);
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px;
}

.modal-footer-debug {
  margin-top: 16px;
  text-align: center;
  border-top: 1px solid var(--gray-200);
  padding-top: 12px;
}

.modal-footer-debug a {
  font-size: 12px;
  color: var(--gray-500);
  text-decoration: none;
}

.modal-footer-debug a:hover {
  color: var(--accent);
}

/* SETTINGS MODAL FORM */
.form-row {
  display: flex;
  gap: 14px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.settings-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-900);
  border: 1px solid var(--gray-300);
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

/* DEBUG DRAWER */
.debug-drawer {
  position: fixed;
  right: 0;
  top: 0;
  width: 480px;
  height: 100vh;
  background: #0f172a;
  color: #f8fafc;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.4);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.debug-drawer.closed {
  transform: translateX(100%);
}

.drawer-header {
  padding: 16px 20px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 15px;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-xs-outline {
  background: transparent;
  border: 1px solid #475569;
  color: #cbd5e1;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}

.btn-drawer-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
  margin-left: 10px;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.log-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.empty-logs-msg {
  color: #64748b;
  font-size: 13px;
  text-align: center;
  padding: 40px 10px;
}

.log-card {
  background: #1e293b;
  border-radius: 8px;
  border: 1px solid #334155;
  overflow: hidden;
  font-size: 12px;
}

.log-header {
  padding: 8px 12px;
  background: #0f172a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: monospace;
}

.log-method {
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.log-method.POST { background: #0284c7; color: white; }
.log-method.GET { background: #059669; color: white; }

.log-status {
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.log-status.s200 { background: #065f46; color: #a7f3d0; }
.log-status.s400 { background: #991b1b; color: #fca5a5; }

.log-body {
  padding: 12px;
  font-family: monospace;
}

.log-url {
  color: #38bdf8;
  word-break: break-all;
  margin-bottom: 8px;
}

.log-section-title {
  color: #94a3b8;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 8px;
  margin-bottom: 4px;
}

pre.code-block {
  background: #090d16;
  padding: 8px;
  border-radius: 4px;
  overflow-x: auto;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-all;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 640px) {
  .debug-drawer {
    width: 100vw;
  }
  .form-row {
    flex-direction: column;
  }
}
