/* automat.as — Firma electrónica (demo estática) */
@import url("https://fonts.googleapis.com/css2?family=Lexend:wght@600;700;800&family=Syne:wght@500;600;700;800&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

:root {
  --ink: #0b1220;
  --ink-soft: #1a2438;
  --paper: #f0f4f8;
  --paper-2: #e2e9f0;
  --line: #c8d3de;
  --muted: #4a5c70;
  --accent: #0f766e;
  --accent-bright: #14b8a6;
  --cta: #c2410c;
  --cta-hover: #f97316;
  --ok: #0f766e;
  --err: #b42318;
  --radius: 2px;
  --max: 42rem;
  --font-brand: "Lexend", sans-serif;
  --font-display: "Syne", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--ink);
}

/* —— Hero —— */
.hero {
  position: relative;
  overflow: hidden;
  color: var(--paper);
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, #1a4a4a 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 10% 80%, #1e3a5f 0%, transparent 50%),
    linear-gradient(165deg, #0b1220 0%, #132033 45%, #0f1a28 100%);
  padding: 1.25rem 1.5rem 3.5rem;
}

.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--accent-bright) 12%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--accent-bright) 12%, transparent) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 60% 40%, black 20%, transparent 75%);
  opacity: 0.4;
  animation: grid-drift 28s linear infinite;
  pointer-events: none;
}

@keyframes grid-drift {
  from { transform: translate(0, 0); }
  to { transform: translate(48px, 48px); }
}

.hero__visual {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0 4% 6%;
  pointer-events: none;
}

.hero__visual svg {
  width: min(48vw, 420px);
  height: auto;
  opacity: 0.85;
}

.nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 56rem;
  margin: 0 auto 2.5rem;
}

.nav__brand {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--paper);
  text-decoration: none;
}

.nav__brand:hover {
  color: var(--cta-hover);
}

.nav__links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--paper) 80%, transparent);
  text-decoration: none;
}

.nav__link:hover {
  color: var(--cta-hover);
}

.nav__link--active {
  color: var(--cta-hover);
  font-weight: 600;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 56rem;
  margin: 0 auto;
}

.hero__brand {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: clamp(2.25rem, 7vw, 3.75rem);
  letter-spacing: -0.025em;
  line-height: 1;
  margin: 0 0 0.75rem;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.25rem, 2.8vw, 1.75rem);
  letter-spacing: -0.02em;
  line-height: 1.25;
  max-width: 22ch;
  margin: 0 0 0.75rem;
  color: color-mix(in srgb, var(--paper) 92%, var(--accent-bright));
}

.hero__lead {
  max-width: 40ch;
  margin: 0;
  font-size: 1rem;
  color: color-mix(in srgb, var(--paper) 70%, transparent);
}

.reveal {
  opacity: 0;
  transform: translateY(1rem);
  animation: reveal-in 0.7s var(--ease) forwards;
}

.reveal:nth-child(2) { animation-delay: 0.1s; }
.reveal:nth-child(3) { animation-delay: 0.2s; }

@keyframes reveal-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— Main —— */
main {
  max-width: var(--max);
  margin: -1.5rem auto 0;
  padding: 0 1.25rem 3rem;
  position: relative;
  z-index: 3;
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
  box-shadow: 0 12px 40px color-mix(in srgb, var(--ink) 6%, transparent);
}

.panel h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

.sub {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0 0 1rem;
}

.warn-box {
  border-left: 3px solid var(--cta);
  padding: 0.6rem 0.85rem;
  background: #fff8f0;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: var(--ink-soft);
}

label {
  display: block;
  margin: 0.55rem 0 0.25rem;
  font-weight: 600;
  font-size: 0.9rem;
}

input[type="file"],
input[type="text"],
input[type="number"],
select,
button,
textarea {
  font: inherit;
}

select,
input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: end;
}

.row > * {
  flex: 1 1 10rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

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

.btn--primary {
  background: var(--cta);
  color: #fff7ed;
  margin-top: 1rem;
}

.btn--primary:hover:not(:disabled) {
  background: var(--cta-hover);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
  margin-top: 1rem;
  margin-left: 0.5rem;
}

.btn--ghost:hover:not(:disabled) {
  border-color: var(--accent);
}

.btn--link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  font-size: 0.875rem;
}

fieldset.visible {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}

fieldset.visible legend {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  padding: 0 0.35rem;
  color: var(--ink-soft);
}

#status {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.ok {
  color: var(--ok);
  font-weight: 600;
}

.err {
  color: var(--err);
  font-weight: 600;
}

#log {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: 12px/1.4 ui-monospace, monospace;
  max-height: 14rem;
  overflow: auto;
  background: var(--ink);
  color: #d7e0ea;
  padding: 0.75rem;
  border-radius: var(--radius);
}

#log .ok {
  color: var(--accent-bright);
}

#log .err {
  color: #fb7185;
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
}

@media (max-width: 640px) {
  .hero__visual {
    opacity: 0.35;
  }

  .btn--ghost {
    margin-left: 0;
  }
}
