/* =========================================================
   Lyzard – Design System
   Primary: #A6D608  |  Background: #EFEFEF  |  White: #FFFFFF
   ========================================================= */

:root {
  --color-primary:         #A6D608;
  --color-primary-hover:   #91BC06;
  --color-primary-dark:    #7A9E05;
  --color-primary-light:   #D4ED6A;
  --color-primary-muted:   #F2FAC4;

  --color-bg:              #EBEBEB;
  --color-surface:         #FFFFFF;

  --color-text-primary:    #0F1117;
  --color-text-secondary:  #6B7280;
  --color-text-muted:      #A3A8B0;

  --color-border:          #E2E5EA;
  --color-border-focus:    #A6D608;

  --color-error:           #E53E3E;
  --color-error-bg:        #FFF5F5;
  --color-error-border:    rgba(229,62,62,.2);

  --radius-sm:   6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;

  --shadow-card: 0 2px 8px rgba(0,0,0,.06), 0 16px 48px rgba(0,0,0,.08);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 140ms cubic-bezier(.4,0,.2,1);
}

/* ── Reset ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.5;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Fondo sutil con puntos de marca */
  background-image: radial-gradient(circle, rgba(166,214,8,.10) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* ── Auth card ────────────────────────────────────────── */
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 2.75rem 2.5rem 2.25rem;
  margin: 1.5rem;
  /* Acento de marca en el borde superior */
  border-top: 3px solid var(--color-primary);
}

/* ── Brand ────────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-bottom: 2.25rem;
}

.brand-logo {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.brand-name {
  font-family: 'Space Grotesk', var(--font-sans);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-primary-dark);
  line-height: 1;
}

/* ── Heading ──────────────────────────────────────────── */
.auth-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-primary);
  text-align: center;
  margin-bottom: .3rem;
  letter-spacing: -0.01em;
}

.auth-subheading {
  font-size: .875rem;
  color: var(--color-text-secondary);
  text-align: center;
  margin-bottom: 2rem;
}

/* ── Divisor visual ───────────────────────────────────── */
.auth-divider {
  width: 32px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  margin: 0 auto 2rem;
}

/* ── Form ─────────────────────────────────────────────── */
.form-group { margin-bottom: 1.125rem; }

.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: .45rem;
}

.form-input {
  width: 100%;
  height: 46px;
  padding: 0 .9rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: .9375rem;
  font-family: var(--font-sans);
  color: var(--color-text-primary);
  background: #FAFAFA;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input::placeholder { color: var(--color-text-muted); }

.form-input:focus {
  background: var(--color-surface);
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(166,214,8,.13);
}

.form-input.is-error  { border-color: var(--color-error); background: var(--color-error-bg); }
.form-input.is-error:focus { box-shadow: 0 0 0 3px var(--color-error-border); }

.form-error {
  display: none;
  font-size: .78rem;
  color: var(--color-error);
  margin-top: .35rem;
}
.form-error.visible { display: block; }

/* ── Campo contraseña ─────────────────────────────────── */
.input-wrapper { position: relative; }
.input-wrapper .form-input { padding-right: 2.75rem; }

.btn-toggle-password {
  position: absolute;
  right: .8rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 0;
  line-height: 0;
  transition: color var(--transition);
}
.btn-toggle-password:hover { color: var(--color-text-secondary); }

/* ── Alerta global ────────────────────────────────────── */
.alert {
  display: none;
  padding: .7rem .9rem;
  border-radius: var(--radius-md);
  font-size: .85rem;
  margin-bottom: 1.25rem;
  line-height: 1.4;
}
.alert.visible   { display: flex; align-items: flex-start; gap: .5rem; }
.alert-error     { background: var(--color-error-bg); color: var(--color-error); border: 1px solid var(--color-error-border); }
.alert-success   { background: #F0FDF4; color: #166534; border: 1px solid rgba(34,197,94,.2); }

/* ── Botón principal ──────────────────────────────────── */
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  height: 46px;
  margin-top: 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  outline: none;
  user-select: none;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  box-shadow: 0 1px 3px rgba(166,214,8,.25), 0 4px 12px rgba(166,214,8,.15);
}

.btn-submit:hover:not(:disabled) {
  background: var(--color-primary-hover);
  box-shadow: 0 2px 6px rgba(166,214,8,.3), 0 8px 20px rgba(166,214,8,.2);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(166,214,8,.2);
}

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

/* Spinner de carga */
.btn-submit .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(15,17,23,.2);
  border-top-color: var(--color-text-primary);
  border-radius: 50%;
  animation: spin .65s linear infinite;
  display: none;
  flex-shrink: 0;
}

.btn-submit.is-loading .spinner   { display: block; }
.btn-submit.is-loading .btn-label { opacity: 0; width: 0; overflow: hidden; }

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

/* ── Pie del formulario ───────────────────────────────── */
.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: .8rem;
  color: var(--color-text-muted);
}

.auth-footer a {
  color: var(--color-primary-dark);
  text-decoration: none;
  font-weight: 500;
}
.auth-footer a:hover { text-decoration: underline; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 440px) {
  .auth-card { padding: 2rem 1.5rem 1.75rem; margin: 1rem; }
}
