:root {
  --radius: 0.625rem;
  --background: #ffffff;
  --foreground: #0f1a14;
  --card: #ffffff;
  --card-foreground: #0f1a14;
  --popover: #ffffff;
  --popover-foreground: #0f1a14;
  --primary: #15803d;
  --primary-foreground: #ffffff;
  --secondary: #ecf4ef;
  --secondary-foreground: #14532d;
  --muted: #f1f5f2;
  --muted-foreground: #556259;
  --accent: #e1f0e6;
  --accent-foreground: #14532d;
  --destructive: #c21f1f;
  --destructive-foreground: #ffffff;
  --success: #166534;
  --success-foreground: #ffffff;
  --warning: #f2b233;
  --warning-foreground: #2b1d04;
  --warning-border: #b7791f;
  --border: #dbe3de;
  --input: #879489;
  --ring: #15803d;
  --overlay: rgb(10 20 14 / 0.5);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
  --radius: 0.625rem;
  --background: #0b120e;
  --foreground: #e6efe9;
  --card: #111a15;
  --card-foreground: #e6efe9;
  --popover: #141f19;
  --popover-foreground: #e6efe9;
  --primary: #34c46a;
  --primary-foreground: #04200f;
  --secondary: #1b2821;
  --secondary-foreground: #e6efe9;
  --muted: #18231d;
  --muted-foreground: #9db0a4;
  --accent: #1f3127;
  --accent-foreground: #e6efe9;
  --destructive: #f2716b;
  --destructive-foreground: #2a0606;
  --success: #3ccb74;
  --success-foreground: #04200f;
  --warning: #f5be4f;
  --warning-foreground: #2b1d04;
  --warning-border: #d99a2b;
  --border: #26342c;
  --input: #5d6e63;
  --ring: #34c46a;
  --overlay: rgb(0 0 0 / 0.65);
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.4);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.5), 0 1px 2px -1px rgb(0 0 0 / 0.5);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}
.dark {
  --radius: 0.625rem;
  --background: #0b120e;
  --foreground: #e6efe9;
  --card: #111a15;
  --card-foreground: #e6efe9;
  --popover: #141f19;
  --popover-foreground: #e6efe9;
  --primary: #34c46a;
  --primary-foreground: #04200f;
  --secondary: #1b2821;
  --secondary-foreground: #e6efe9;
  --muted: #18231d;
  --muted-foreground: #9db0a4;
  --accent: #1f3127;
  --accent-foreground: #e6efe9;
  --destructive: #f2716b;
  --destructive-foreground: #2a0606;
  --success: #3ccb74;
  --success-foreground: #04200f;
  --warning: #f5be4f;
  --warning-foreground: #2b1d04;
  --warning-border: #d99a2b;
  --border: #26342c;
  --input: #5d6e63;
  --ring: #34c46a;
  --overlay: rgb(0 0 0 / 0.65);
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.4);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.5), 0 1px 2px -1px rgb(0 0 0 / 0.5);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5);
  color-scheme: dark;
}

/*
 * Componentes de las páginas de grumpy-auth. Aquí no hay ningún color: solo tokens de
 * @grumpy-software/ui, que /assets/grumpy.css antepone desde src/ui/theme.ts.
 */
/* Inter de @fontsource/inter (latin), servida por el propio servicio: la CSP es font-src 'self'. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/assets/fonts/inter-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("/assets/fonts/inter-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("/assets/fonts/inter-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("/assets/fonts/inter-latin-700-normal.woff2") format("woff2");
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--background);
  color: var(--foreground);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.ga-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.ga-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
}

.ga-card[data-tone="error"] {
  border-color: var(--destructive);
}

.ga-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ga-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: calc(var(--radius) - 2px);
  background: var(--primary);
  color: var(--primary-foreground);
  display: grid;
  place-items: center;
  font-weight: 700;
}

.ga-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 600;
}

.ga-text {
  margin: 0 0 20px;
  color: var(--muted-foreground);
}

.ga-text:last-child {
  margin-bottom: 0;
}

.ga-icon {
  display: block;
  width: 24px;
  height: 24px;
  margin-bottom: 12px;
}

.ga-card[data-tone="error"] .ga-icon {
  color: var(--destructive);
}

.ga-notice {
  margin-bottom: 20px;
}

.ga-stack {
  display: grid;
  gap: 12px;
}

.ga-alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--destructive);
  border-radius: var(--radius);
  color: var(--foreground);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.ga-alert .ga-icon {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  color: var(--destructive);
}

/* Como la variante `warning` de Alert en @grumpy-software/ui. */
.ga-alert[data-tone="warning"] {
  border-color: var(--warning-border);
  background: color-mix(in oklab, var(--warning) 15%, var(--card));
  color: var(--foreground);
}

.ga-alert[data-tone="warning"] .ga-icon {
  color: var(--warning-border);
}

.ga-alert-title {
  margin: 0;
  font-weight: 500;
}

.ga-alert-text {
  margin: 2px 0 0;
  color: var(--muted-foreground);
}

.ga-field-error {
  margin: 6px 0 0;
  color: var(--destructive);
  font-size: 0.875rem;
}

.ga-center {
  justify-items: center;
  text-align: center;
}

.ga-strong {
  color: var(--foreground);
  font-weight: 500;
}

.ga-badge-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-foreground);
}

.ga-icon.ga-icon-lg {
  width: 24px;
  height: 24px;
  margin: 0;
}

.ga-icon.ga-icon-sm {
  width: 18px;
  height: 18px;
  margin: 0;
}

.ga-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.ga-divider::before,
.ga-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}

.ga-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.875rem;
  font-weight: 500;
}

.ga-input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--background);
  color: var(--foreground);
  font: inherit;
}

.ga-input[aria-invalid="true"] {
  border-color: var(--destructive);
}

/* Anillo de foco: --ring a opacidad completa y 2px de separación. */
.ga-button:focus-visible,
.ga-input:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.ga-button {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-foreground);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.ga-button:hover {
  background: color-mix(in oklab, var(--primary), var(--foreground) 15%);
}

.ga-button-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--foreground);
}

.ga-button-outline:hover {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.ga-button-ghost {
  background: transparent;
  color: var(--foreground);
}

.ga-button-ghost:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

.ga-button:disabled,
.ga-button[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.ga-button[aria-busy="true"] {
  cursor: progress;
  pointer-events: none;
}

.ga-button[aria-busy="true"]::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ga-spin 0.8s linear infinite;
}

.ga-spinner {
  width: 20px;
  height: 20px;
  margin-bottom: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: ga-spin 0.8s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .ga-spinner,
  .ga-button[aria-busy="true"]::before {
    animation: none;
  }
}
