:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-dark: #0b1329;
  --card-bg: #151f38;
  --border: #2a3756;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --success: #22c55e;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 16px;
}

.app-container {
  width: 100%;
  max-width: 820px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

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

.brand-logo {
  width: 52px;
  height: 52px;
  display: block;
  filter: drop-shadow(0 6px 18px rgba(56, 189, 248, 0.25));
}

.logo h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.badge-free {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.wizard-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
}

/* Abas Horizontais */
.horizontal-tabs-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(11, 19, 41, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 32px;
  gap: 6px;
}

.tab-step-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-step-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

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

.tab-step-btn:not(.disabled):hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.step-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.tab-arrow {
  color: var(--border);
  font-size: 1.2rem;
  user-select: none;
}

/* Painéis de Etapa */
.step-content {
  display: none;
}

.step-content.active {
  display: block;
}

.panel-header {
  margin-bottom: 24px;
}

.panel-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* Provedores */
.provider-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.provider-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  background: rgba(11, 19, 41, 0.3);
}

.provider-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.03);
}

.provider-card.selected {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.08);
}

.provider-card.provider-unavailable {
  opacity: 0.52;
  cursor: not-allowed;
  border-style: dashed;
}

.provider-availability-note {
  color: #fbbf24 !important;
  font-size: 0.76rem !important;
  margin: 10px 0 0 !important;
}

.provider-card input[type="radio"] {
  position: absolute;
  top: 20px;
  right: 20px;
  accent-color: var(--accent);
}

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

.provider-icon {
  font-size: 1.6rem;
}

.provider-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
  display: inline-block;
  margin-right: 8px;
}

.tag-rec {
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  vertical-align: middle;
}

.provider-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}

.provider-features {
  list-style: none;
  font-size: 0.8rem;
  color: var(--success);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Formulários */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: #0b1329;
  border: 1px solid var(--border);
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.input-with-button {
  display: flex;
  gap: 8px;
}

.hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 5px;
  display: block;
}

.validation-error {
  margin-top: 6px;
  font-size: 0.82rem;
  color: #f87171;
  font-weight: 500;
}

.validation-error.hidden {
  display: none;
}

/* Migration Card */
.migration-card {
  background: rgba(11, 19, 41, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 24px;
}

.migration-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.migration-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}

.migration-title input {
  accent-color: var(--primary);
}

.migration-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
  margin-left: 24px;
}

.badge-optional {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
}

.migration-fields {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.migration-fields.hidden {
  display: none;
}

.mongo-test-feedback {
  margin-top: 10px;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
}

.mongo-test-feedback.hidden {
  display: none;
}

.mongo-test-feedback.success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.mongo-test-feedback.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* Botões & Linhas de Ação */
.actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.mt-12 {
  margin-top: 12px;
}

.btn {
  padding: 11px 22px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.82rem;
  background: var(--border);
  color: #fff;
}

.btn-sm:hover {
  background: #3b4d75;
}

.btn-accent {
  background: #0284c7;
  color: #fff;
}

.btn-accent:hover {
  background: #0369a1;
}

.btn-large {
  width: 100%;
  padding: 14px 24px;
  font-size: 1.05rem;
  border-radius: 10px;
}

/* Resumo & Deploy */
.summary-box {
  background: rgba(11, 19, 41, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 24px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.summary-item:last-child {
  border-bottom: none;
}

.sum-label {
  color: var(--text-muted);
}

.sum-val {
  font-weight: 600;
  color: var(--accent);
}

.provider-login-guide {
  background: rgba(56, 189, 248, 0.07);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 20px;
}

.provider-login-guide h3 {
  font-size: 0.98rem;
  margin-bottom: 10px;
}

.provider-login-guide ol {
  margin-left: 20px;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.65;
}

.provider-login-guide p {
  margin-top: 10px;
  color: var(--accent);
  font-size: 0.8rem;
}

.provider-login-guide code {
  color: #fff;
}

.deploy-action-box {
  margin-bottom: 24px;
}

.deploy-progress-area {
  margin-top: 24px;
}

.deploy-progress-area.hidden {
  display: none;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-bar {
  height: 100%;
  width: 10%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.4s ease;
}

.terminal-box {
  background: #070d1d;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-family: monospace;
  font-size: 0.85rem;
  color: #38bdf8;
  height: 160px;
  overflow-y: auto;
  margin-bottom: 24px;
}

.log-line {
  margin-bottom: 6px;
}

/* Resultado Final - Exclusivo pós-deploy */
.result-box.hidden {
  display: none;
}

.success-banner {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.success-icon {
  font-size: 2.2rem;
}

.info-card {
  background: #0b1329;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 20px;
}

.info-item {
  margin-bottom: 14px;
}

.info-item:last-child {
  margin-bottom: 0;
}

.copy-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #151f38;
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 8px;
  margin-top: 6px;
}

.copy-box a, .copy-box span {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  word-break: break-all;
}

.save-creds-card {
  background: rgba(11, 19, 41, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 24px;
}

.save-creds-card h4 {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.save-creds-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.save-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Guias de Conexão */
.setup-guides {
  background: #0b1329;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 24px;
}

.setup-guides h4 {
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.guide-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.tab-btn {
  background: #151f38;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
}

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

.guide-content {
  display: none;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.guide-content.active {
  display: block;
}

.guide-content code {
  background: #151f38;
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.82rem;
  display: inline-block;
  margin-top: 6px;
}

.final-open-action {
  margin-top: 16px;
}

.footer {
  margin-top: 32px;
  padding: 20px;
  background: rgba(11, 19, 41, 0.4);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.footer-content {
  max-width: 740px;
  margin: 0 auto;
  text-align: center;
}

.footer-license {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.footer-legal-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.8rem;
}

.footer-legal-links a {
  color: var(--accent);
  text-decoration: none;
}

.footer-legal-links a:hover {
  text-decoration: underline;
}

.footer-disclaimer {
  font-size: 0.78rem;
  color: #7e8c9f;
  line-height: 1.5;
  text-align: justify;
}

.footer-disclaimer strong {
  color: #fca5a5;
}
