/*
  © 2025 Essiou - Marketing Solutions, Lda.  Todos os direitos reservados.
  Autor: Pedro Fernandes · https://essiou.pt
  Aviso: Este código é propriedade intelectual da Essiou - Marketing Solutions, Lda.
  É proibida a cópia, redistribuição ou utilização não autorizada, total ou parcial.
*/

:root {
  --bg: #0b1020; /* fundo escuro, elegante */
  --card: #141a2e;
  --muted: #96a0b5;
  --text: #eaf0ff;
  --acc: #6aa5ff;
  --acc-2: #7cf0c7;
  --danger: #ff6b6b;
  --ok: #2ecc71;
  --border: #25304f;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --radius: 18px;
}
/* Tema claro */
body.light {
  --bg: #f6f8ff;
  --card: #ffffff;
  --muted: #5a647a;
  --text: #0d1b2a;
  --acc: #2f6fff;
  --acc-2: #00c7a5;
  --danger: #c62828;
  --ok: #2e7d32;
  --border: #dbe3ff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu,
    "Helvetica Neue", "Noto Sans", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(
      1200px 600px at 10% -10%,
      #1d2950 0%,
      transparent 60%
    ),
    radial-gradient(900px 700px at 110% 10%, #11385d 0%, transparent 60%),
    var(--bg);
  color: var(--text);
}
body.light {
  background: var(--bg);
}
a {
  color: var(--acc);
}
.wrap {
  max-width: 1050px;
  margin: 48px auto;
  padding: 0 20px;
}
header {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.title {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  letter-spacing: 0.2px;
}
.tabs {
  display: flex;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
body.light .tabs {
  background: #f4f7ff;
}
.tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}
.tab.active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
}

.card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.02)
  );
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
body.light .card {
  background: #fff;
}
.card .body {
  padding: 22px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 820px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* ── Responsividade ─────────────────────────── */

/* Tablet */
@media (max-width: 860px) {
  .wrap {
    margin: 24px auto;
  }
  header .row {
    flex-wrap: wrap;
    gap: 12px;
  }
  .tabs {
    width: 100%;
    justify-content: stretch;
  }
  .tabs .tab {
    flex: 1;
    text-align: center;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .wrap {
    margin: 12px auto;
    padding: 0 12px;
  }

  /* Header */
  header .row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .tabs {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    justify-content: flex-start;
    scrollbar-width: none;
    padding: 6px;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 13px;
  }

  /* Card body */
  .card .body {
    padding: 14px;
  }

  /* Radios e tag no topo do form */
  .row[style*="justify-content:space-between"] {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .tag {
    width: 100%;
    justify-content: center;
  }

  /* Grid → 1 col */
  .grid {
    grid-template-columns: 1fr;
  }

  /* Actions */
  .actions {
    flex-direction: column-reverse;
  }
  .actions .btn {
    width: 100%;
  }

  /* Modal */
  .modal header h3 {
    font-size: 16px;
  }
  .modal .content {
    padding: 14px;
  }
  .modal .actions {
    padding: 0 14px 14px;
    flex-direction: column-reverse;
  }
  .modal .actions .btn {
    width: 100%;
  }

  /* Dropzone */
  .dropzone {
    padding: 20px 14px;
  }

  /* Termos — wrapping labels */
  .row[role="radiogroup"] {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Success modal code */
  #successCode {
    font-size: 1.1rem !important;
    letter-spacing: 1px !important;
  }
}

label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin: 8px 2px;
}
.req::after {
  content: " *";
  color: var(--danger);
}
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
textarea,
.fake-input {
  width: 100%;
  background: #0f1426;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 12px;
  outline: none;
  font: inherit;
}
body.light input[type="text"],
body.light input[type="email"],
body.light input[type="tel"],
body.light input[type="date"],
body.light textarea {
  background: #f8fbff;
}
textarea {
  min-height: 110px;
  resize: vertical;
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.radio {
  display: flex;
  gap: 10px;
  align-items: center;
}
.radio input {
  accent-color: var(--acc);
}
.checkbox input {
  accent-color: var(--acc);
}

.help {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}
.btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}
.btn.primary {
  background: var(--acc);
  color: #0a1330;
}
body.light .btn.primary {
  color: #fff;
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.hidden {
  display: none !important;
}

.note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}
.note .law {
  font-weight: 600;
}

.status {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  display: none;
}
body.light .status {
  background: #f7f9ff;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 23, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}
body.light .modal-backdrop {
  background: rgba(13, 27, 42, 0.3);
}
.modal {
  width: min(560px, 100%);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.02)
  );
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
body.light .modal {
  background: #fff;
}
.modal header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.modal header h3 {
  margin: 0;
  font-size: 18px;
}
.modal .content {
  padding: 18px;
}
.modal .actions {
  padding: 0 18px 18px;
}

.modal-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.35);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
}
.modal-warning svg {
  flex-shrink: 0;
  color: #ff6b6b;
  margin-top: 1px;
}
body.light .modal-warning {
  background: rgba(220, 38, 38, 0.07);
  border-color: rgba(220, 38, 38, 0.3);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px dashed var(--border);
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 14px;
}
body.light .tag {
  background: #f6f8ff;
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Botão de tema fixo no lado direito do ecrã */
.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1100;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  transition: background 0.2s, color 0.2s;
}
body.light .theme-toggle {
  background: #ffffff;
  color: var(--text);
}
/* Modo escuro (default): mostra sol; modo claro: mostra lua */
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun  { display: block; }
body.light .theme-toggle .icon-sun  { display: none; }
body.light .theme-toggle .icon-moon { display: block; }
/* Dropzone */
.dropzone {
  position: relative;
  border: 1.5px dashed var(--border);
  border-radius: 14px;
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  color: var(--muted);
}
.dropzone:hover,
.dropzone.over {
  border-color: var(--acc);
  background: rgba(106,165,255,0.05);
  color: var(--acc);
}
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.dropzone svg {
  display: block;
  margin: 0 auto 12px;
  opacity: 0.7;
}
.dropzone-label {
  margin: 0 0 4px;
  font-size: 0.9rem;
  font-weight: 500;
}
.dropzone-label span {
  color: var(--acc);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.dropzone-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dropzone-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text);
}
.dropzone-list li svg {
  margin: 0;
  flex-shrink: 0;
  opacity: 0.5;
}
body.light .dropzone-list li {
  background: rgba(0,0,0,0.04);
}
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  text-align: center;
  padding: 12px;
  font-size: 11px;
  color: var(--muted);
  background: transparent;
  pointer-events: none;
}
.footer-inner { display: flex; justify-content: center; }