@font-face {
  font-family: "Signature Krona One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assinatura-email/fonts/KronaOne-Regular.ttf") format("truetype");
}

:root {
  color-scheme: light;
  --brand: #1f3177;
  --brand-hover: #121f53;
  --accent: #d84525;
  --text: #484848;
  --muted: #72747c;
  --line: #d9dce4;
  --surface: #ffffff;
  --background: #f3f4f6;
  font-family: "Signature Krona One", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 40px;
  background: var(--background);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

.container {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 30px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 35px rgb(18 31 83 / 10%);
}

.page-header {
  max-width: 720px;
  margin: 0 auto 30px;
  text-align: center;
}

.page-header h1 {
  margin: 0;
  color: var(--brand);
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.25;
  letter-spacing: 0;
}

.page-header > p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.content {
  display: grid;
  grid-template-columns: minmax(250px, 0.7fr) minmax(0, 1.3fr);
  gap: 30px;
  align-items: start;
}

.form-area {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.field label,
.preview-area h2 {
  color: var(--brand);
  font-size: 0.82rem;
  line-height: 1.4;
}

.field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.field input:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgb(31 49 119 / 14%);
}

.preview-area {
  min-width: 0;
}

.preview-area h2 {
  margin: 0 0 12px;
}

#previewCanvas,
#assinaturaFinal {
  display: block;
  width: min(525px, 100%);
  height: auto;
  aspect-ratio: 940 / 239;
  border: 1px solid #eceef2;
  background: #fff;
}

.button,
button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-family: "Signature Krona One", Arial, sans-serif;
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.button:hover,
button:hover {
  border-color: var(--brand-hover);
  background: var(--brand-hover);
}

.button:focus-visible,
button:focus-visible {
  outline: 3px solid rgb(31 49 119 / 24%);
  outline-offset: 2px;
}

.button-secondary {
  background: #fff;
  color: var(--brand);
}

.button-secondary:hover {
  color: #fff;
}

.form-error {
  margin: 0;
  color: #b42318;
  font-family: Arial, sans-serif;
  font-size: 0.88rem;
  line-height: 1.4;
}

.hidden {
  display: none !important;
}

.fade-in {
  animation: fade-in 300ms ease forwards;
}

.status,
.result {
  text-align: center;
}

.status {
  padding: 45px 0 20px;
}

.status p {
  margin: 12px 0 0;
}

.spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border: 5px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.result {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.success-message {
  margin: 0 0 18px;
  color: #157347;
  font-size: 1rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 900px) {
  body {
    padding: 20px;
  }

  .container {
    padding: 24px;
  }

  .content {
    grid-template-columns: 1fr;
  }

  #previewCanvas,
  #assinaturaFinal {
    width: 100%;
  }
}

@media (max-width: 520px) {
  body {
    padding: 12px;
  }

  .container {
    padding: 20px 16px;
  }

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

  .actions {
    width: 100%;
    flex-direction: column;
  }

  .actions .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
