/* Tokens de brayandiazc.com (src/styles/theme.css de ese repo) */
:root,
[data-theme="light"] {
  --background: #fdfdfd;
  --foreground: #282728;
  --accent: #006cac;
  --muted: #e6e6e6;
  --muted-foreground: #6b7280;
  --border: #ece9e9;
}

[data-theme="dark"] {
  --background: #212737;
  --foreground: #eaedf3;
  --accent: #ff6b01;
  --muted: #343f60;
  --muted-foreground: #afb9ca;
  --border: #4a5578;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Google Sans Code", ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  width: min(1080px, 100% - 3rem);
  margin: 0 auto;
  flex: 1;
}

/* — Cabecera — */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(1080px, 100% - 3rem);
  margin: 0 auto;
  padding: 1.25rem 0;
}

.brand {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-logo {
  width: 1.2rem;
  height: 1.2rem;
  flex: 0 0 auto;
  display: block;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#page-theme,
#page-lang {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--foreground);
  width: 2.2rem;
  height: 2.2rem;
  font-size: 1rem;
  cursor: pointer;
}

#page-lang {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

#page-theme:hover,
#page-lang:hover {
  border-color: var(--accent);
}

/* — Intro — */
.intro {
  padding: 3.5rem 0 1.5rem;
}

h1 {
  font-size: clamp(1.7rem, 4.5vw, 2.9rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

h1 .accent {
  color: var(--accent);
}

.lede {
  max-width: 58ch;
  color: var(--muted-foreground);
  margin: 0;
}

code {
  background: var(--muted);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-family: inherit;
  font-size: 0.92em;
}

/* — Prompt — */
.prompt {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.4rem 0.4rem 0.4rem 1rem;
  background: color-mix(in srgb, var(--muted) 35%, var(--background));
}

.prompt:focus-within {
  border-color: var(--accent);
}

.prompt-symbol {
  color: var(--accent);
  font-weight: 700;
}

#repo {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  color: var(--foreground);
  font: inherit;
  font-size: 1.05rem;
  padding: 0.55rem 0;
}

#repo:focus {
  outline: none;
}

#repo::placeholder {
  color: var(--muted-foreground);
  opacity: 0.7;
}

button {
  font-family: inherit;
}

#generate,
.dl button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 0.6rem 1.3rem;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
}

#generate:hover,
.dl button:hover {
  filter: brightness(1.12);
}

#status {
  min-height: 1.4em;
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--muted-foreground);
}

#status.error {
  color: #d33f2e;
}

[data-theme="dark"] #status.error {
  color: #ff8a75;
}

/* — Campos editables — */
#workbench {
  margin: 2.5rem 0 4rem;
}

.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem 1.5rem;
  margin-bottom: 2.5rem;
}

.field-wide {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted-foreground);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.field label small {
  text-transform: none;
  letter-spacing: 0;
}

.field input[type="text"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  color: var(--foreground);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.55rem 0.75rem;
}

.field input[type="text"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.field-check {
  align-self: end;
}

.field-check label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9rem;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* — Previews — */
.previews {
  display: grid;
  gap: 2.5rem;
}

.preview header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.preview h2 {
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-foreground);
  margin: 0;
}

.preview h2::before {
  content: "── ";
  color: var(--accent);
}

.dl {
  margin: 0;
  display: flex;
  gap: 0.5rem;
}

.dl button {
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  background: none;
  color: var(--accent);
}

.dl button:hover {
  background: var(--accent);
  color: #fff;
  filter: none;
}

.canvas {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 40px -18px rgb(0 0 0 / 0.35);
}

.canvas svg {
  display: block;
  width: 100%;
  height: auto;
}

/* — Pie — */
.bottom {
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.bottom p {
  width: min(1080px, 100% - 3rem);
  margin: 0 auto;
  padding: 1.25rem 0;
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

.bottom a {
  color: var(--accent);
}

/* — Captura de uso — */
.capture {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.capture h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.capture h2::before {
  content: "$ ";
  color: var(--accent);
}

.capture-lede {
  max-width: 60ch;
  margin: 0 0 1.1rem;
  font-size: 0.88rem;
  color: var(--muted-foreground);
}

.capture-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.capture-row input {
  flex: 1 1 200px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  color: var(--foreground);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.55rem 0.75rem;
}

.capture-row input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.capture-row input::placeholder {
  color: var(--muted-foreground);
  opacity: 0.7;
}

#capture-submit {
  flex: 0 0 auto;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 0.55rem 1.3rem;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
}

#capture-submit:hover {
  filter: brightness(1.12);
}

#capture-submit:disabled {
  opacity: 0.6;
  cursor: default;
  filter: none;
}

.capture-msg {
  min-height: 1.3em;
  margin: 0.7rem 0 0;
  font-size: 0.85rem;
  color: var(--accent);
}

.capture-msg.error {
  color: #d33f2e;
}

[data-theme="dark"] .capture-msg.error {
  color: #ff8a75;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

@media (prefers-reduced-motion: no-preference) {
  .canvas svg {
    transition: opacity 0.15s ease;
  }
}
