/* ==========================================================================
   TECSA — Gerador de Assinatura de Email
   Design tokens: cores/fontes extraídos do Manual de Identidade Visual TECSA
   (Aurora skill) — azul #003C82, cinza #8A8C8E, fonte Montserrat
   ========================================================================== */

:root {
  /* Paleta TECSA */
  --tecsa-blue: #003C82;
  --tecsa-blue-hover: #1A5A9E;
  --tecsa-gray: #8A8C8E;
  --tecsa-text: #231F20;
  --tecsa-border: #D0D0D0;
  --tecsa-bg: #F5F5F5;
  --tecsa-bg-soft: #f8f8f7;
  --tecsa-success: #16a34a;

  /* Tipografia */
  --font-sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Espaçamento */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Sombras */
  --shadow-sm: 0 1px 2px rgba(35, 31, 32, 0.04);
  --shadow-md: 0 4px 16px rgba(35, 31, 32, 0.06);
}

/* --- Reset mínimo --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  /* Previne scroll horizontal acidental em mobile */
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--tecsa-text);
  background: var(--tecsa-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  /* Evita que iOS Safari aumente a fonte ao girar a tela */
  -webkit-text-size-adjust: 100%;
}

h1,
h2,
h3,
p,
ol,
ul {
  margin: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input {
  font-family: inherit;
}

/* --- Top bar --- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--tecsa-border);
}

.topbar-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-logo {
  height: 22px;
  width: auto;
  display: block;
}

.topbar-sep {
  width: 1px;
  height: 18px;
  background: var(--tecsa-border);
  display: inline-block;
}

.topbar-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--tecsa-gray);
}

/* --- Page container --- */
.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

@media (max-width: 640px) {
  .page {
    padding: 24px 16px 48px;
  }
}

/* --- Hero --- */
.hero {
  margin-bottom: 24px;
}

.hero-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--tecsa-blue);
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.hero-subtitle {
  font-size: 14px;
  color: var(--tecsa-gray);
  font-weight: 400;
}

/* --- Cards --- */
.card {
  background: #fff;
  border: 1px solid var(--tecsa-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  /* Previne card de estourar a largura do container pai */
  max-width: 100%;
  overflow: hidden;
}

@media (max-width: 640px) {
  .card {
    padding: 20px 18px;
    border-radius: var(--radius-md);
  }
}

/* --- Grid form + preview --- */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

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

/* --- Form --- */
.form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--tecsa-gray);
}

.label-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--tecsa-gray);
}

.input {
  font-size: 14px;
  color: var(--tecsa-text);
  background: #fff;
  border: 1px solid var(--tecsa-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  width: 100%;
}

.input::placeholder {
  color: #b8bbbe;
}

.input:focus {
  border-color: var(--tecsa-blue);
  background: #f4f8fd;
  box-shadow: 0 0 0 3px rgba(0, 60, 130, 0.12);
}

/* --- Button --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  padding: 13px 20px;
  border-radius: var(--radius-md);
  border: none;
  transition: background 0.15s ease, transform 0.05s ease;
  margin-top: 6px;
}

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

.btn-primary:hover:not(.btn-disabled) {
  background: var(--tecsa-blue-hover);
}

.btn-primary:active:not(.btn-disabled) {
  transform: translateY(1px);
}

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

.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* --- Preview column --- */
.preview-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preview-label {
  display: block;
}

.preview-wrap {
  background: var(--tecsa-bg);
  border: 1px solid var(--tecsa-border);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  min-height: 170px;
  /* Scroll horizontal DENTRO do card caso a assinatura seja larga,
     sem estourar o viewport */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  align-items: center;
  /* Limita a largura máxima do wrapper ao container pai */
  max-width: 100%;
}

/* A tabela da assinatura é injetada direto pelo app.js com estilos inline
   (compatíveis com Outlook/Gmail). O CSS abaixo só atua no PREVIEW do site
   para permitir que a tabela não estoure em telas estreitas — os estilos
   inline do HTML copiado pra assinatura permanecem intactos. */
.preview-wrap table {
  /* Permite que a tabela reduza se precisar caber em tela estreita */
  max-width: 100%;
}

@media (max-width: 640px) {
  .preview-wrap {
    padding: 16px 12px;
  }
}

/* --- How to install section --- */
.how-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--tecsa-blue);
  margin-bottom: 16px;
}

.how-list {
  font-size: 13px;
  color: var(--tecsa-text);
  line-height: 1.8;
  padding-left: 20px;
}

.how-list li {
  margin-bottom: 4px;
}

.how-list strong {
  color: var(--tecsa-text);
  font-weight: 600;
}

.how-list kbd {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  background: var(--tecsa-bg);
  border: 1px solid var(--tecsa-border);
  border-radius: 4px;
  padding: 1px 5px;
  margin: 0 1px;
}

/* --- Footer --- */
.footer {
  margin-top: 32px;
  text-align: center;
  font-size: 11px;
  color: var(--tecsa-gray);
  padding-top: 20px;
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--tecsa-success);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
}

.toast[data-visible="true"] {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
