/* ═══════════════════════════════════════════════════════════
   AgroControl — iniciarsesion.css
   Diseño moderno estilo SaaS para pantalla de login
   ═══════════════════════════════════════════════════════════ */

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

:root {
  --green:      #22C55E;
  --green-dark: #16A34A;
  --green-dim:  rgba(34,197,94,0.15);
  --green-glow: rgba(34,197,94,0.30);
  --bg:         #0F172A;
  --surface:    #1E293B;
  --border:     rgba(255,255,255,0.09);
  --border-g:   rgba(34,197,94,0.30);
  --text:       #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim:   #64748B;
  --font:       'Inter', system-ui, sans-serif;
  --ease:       cubic-bezier(0.4,0,0.2,1);
  --spring:     cubic-bezier(0.34,1.56,0.64,1);
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
}

/* ══════════════════════════════════════════════
   HERO — Panel izquierdo (70%)
   ══════════════════════════════════════════════ */
.hero {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 100vh;
}

/* Imagen de fondo */
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('https://images.unsplash.com/photo-1500595046743-cd271d694d30?auto=format&fit=crop&w=1600&q=80');
  background-size: cover;
  background-position: center 30%;
  animation: heroZoom 25s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes heroZoom {
  from { transform: scale(1.00); }
  to   { transform: scale(1.06); }
}

/* Overlay degradado verde oscuro */
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg,
      rgba(5,46,22,0.88)  0%,
      rgba(14,116,44,0.72) 45%,
      rgba(15,23,42,0.92) 100%
    );
}

/* ── PARTÍCULAS decorativas ── */
.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(34,197,94,0.18);
  animation: floatParticle 8s ease-in-out infinite;
}

.p1 { width: 320px; height: 320px; top: -80px;  left: -80px;  animation-delay: 0s;   animation-duration: 10s; }
.p2 { width: 180px; height: 180px; bottom: 10%; right:  8%;   animation-delay: 2s;   animation-duration: 8s;  }
.p3 { width:  90px; height:  90px; top:  35%;   left:  18%;   animation-delay: 1.5s; animation-duration: 7s;  }
.p4 { width: 240px; height: 240px; bottom: -60px; left: 30%;  animation-delay: 3s;   animation-duration: 11s; }
.p5 { width:  60px; height:  60px; top: 20%;    right: 22%;   animation-delay: 0.8s; animation-duration: 6s;  }

@keyframes floatParticle {
  0%, 100% { transform: translateY(0)  scale(1);    opacity: .6; }
  50%       { transform: translateY(-22px) scale(1.08); opacity: 1;  }
}

/* ── CONTENIDO del hero ── */
.hero-content {
  position: relative;
  z-index: 2;
  padding: 64px 72px;
  max-width: 640px;
  animation: fadeSlideUp .9s var(--ease) both;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.28);
  border-radius: 40px;
  padding: 6px 14px;
  font-size: 11.5px;
  font-weight: 500;
  color: #86EFAC;
  letter-spacing: .4px;
  margin-bottom: 28px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 0 3px rgba(34,197,94,.25);
  animation: pulseDot 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(34,197,94,.25); }
  50%       { box-shadow: 0 0 0 6px rgba(34,197,94,.08); }
}

/* Branding */
.hero-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.hero-logo-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(34,197,94,.4), 0 8px 24px rgba(34,197,94,.28);
  flex-shrink: 0;
}

.hero-logo-icon svg {
  width: 28px;
  height: 28px;
}

.hero-title {
  font-size: clamp(42px, 5vw, 68px);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1;
  color: #F8FAFC;
}

.hero-title span {
  color: var(--green);
}

.hero-subtitle {
  font-size: 15.5px;
  color: #CBD5E1;
  line-height: 1.65;
  margin-bottom: 40px;
  font-weight: 400;
  max-width: 400px;
}

/* ── Stats ── */
.hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 36px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  padding: 20px 28px;
  backdrop-filter: blur(6px);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--green-dim);
  border: 1px solid var(--border-g);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--green);
}

.stat-icon svg {
  width: 17px;
  height: 17px;
}

.stat-body {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 26px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: -1px;
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  color: #94A3B8;
  font-weight: 500;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.10);
  margin: 0 24px;
  flex-shrink: 0;
}

/* ── Feature tags ── */
.hero-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.20);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #86EFAC;
}

.feature-tag svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* Degradado inferior del hero */
.hero-footer-grad {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, rgba(15,23,42,0.5), transparent);
  pointer-events: none;
  z-index: 1;
}

/* ══════════════════════════════════════════════
   AUTH PANEL — Panel derecho (30%)
   ══════════════════════════════════════════════ */
.auth-panel {
  width: 420px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-left: 1px solid var(--border);
  padding: 32px 28px;
  position: relative;
  z-index: 5;
  flex-shrink: 0;
  animation: panelIn .7s var(--ease) .15s both;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Card ── */
.auth-card {
  width: 100%;
  max-width: 360px;
}

/* Logo de la card */
.card-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
}

.card-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(34,197,94,.35);
  flex-shrink: 0;
}

.card-logo-icon svg {
  width: 22px;
  height: 22px;
}

.card-logo-text {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--text);
}

.card-logo-text em {
  font-style: normal;
  color: var(--green);
}

/* Títulos */
.card-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.5px;
  color: var(--text);
  margin-bottom: 6px;
}

.card-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* ── Formulario ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Campos */
.field-wrap {
  margin-bottom: 20px;
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #CBD5E1;
  letter-spacing: .3px;
  margin-bottom: 7px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.field-label-row .field-label {
  margin-bottom: 0;
}

.forgot-link {
  font-size: 11.5px;
  color: var(--green);
  text-decoration: none;
  font-weight: 500;
  transition: color .2s;
}

.forgot-link:hover {
  color: #86EFAC;
  text-decoration: underline;
}

.field-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 13px;
  display: flex;
  align-items: center;
  color: var(--text-dim);
  pointer-events: none;
  transition: color .2s;
  z-index: 1;
}

.field-icon svg {
  width: 16px;
  height: 16px;
}

.field-input-wrap input {
  width: 100%;
  height: 46px;
  background: var(--surface);
  border: 1.5px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  padding: 0 42px 0 40px;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  outline: none;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), background .2s;
  caret-color: var(--green);
}

.field-input-wrap input::placeholder {
  color: var(--text-dim);
  font-weight: 400;
}

.field-input-wrap input:hover {
  border-color: rgba(255,255,255,0.20);
  background: #243147;
}

.field-input-wrap input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(34,197,94,.15);
  background: #243147;
}

.field-input-wrap:focus-within .field-icon {
  color: var(--green);
}

/* Botón toggle contraseña */
.toggle-pass {
  position: absolute;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: 6px;
  transition: color .2s, background .2s;
  padding: 0;
  z-index: 2;
}

.toggle-pass:hover {
  color: var(--green);
  background: var(--green-dim);
}

.toggle-pass svg {
  width: 15px;
  height: 15px;
  pointer-events: none;
}

/* ── Checkbox recordarme ── */
.remember-row {
  margin-bottom: 24px;
  margin-top: -4px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  width: 17px;
  height: 17px;
  border-radius: 5px;
  border: 1.5px solid rgba(255,255,255,0.20);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .2s var(--ease);
}

.checkbox-label input:checked + .checkbox-custom {
  background: var(--green);
  border-color: var(--green);
}

.checkbox-label input:checked + .checkbox-custom::after {
  content: '';
  width: 9px;
  height: 9px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%230F172A' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='2,7 5.5,10.5 12,3'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* ── Botón submit ── */
.btn-submit {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #22C55E 0%, #16A34A 60%, #15803D 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,.15) inset,
    0 4px 16px rgba(34,197,94,.35),
    0 1px 3px rgba(0,0,0,.3);
  color: #0A2E14;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .25s var(--ease);
  position: relative;
  overflow: hidden;
}

.btn-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.12), transparent);
  opacity: 0;
  transition: opacity .25s;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255,255,255,.15) inset,
    0 8px 24px rgba(34,197,94,.45),
    0 2px 6px rgba(0,0,0,.35);
}

.btn-submit:hover::before {
  opacity: 1;
}

.btn-submit:active {
  transform: translateY(0) scale(.98);
  box-shadow: 0 2px 8px rgba(34,197,94,.3);
}

.btn-arrow {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  transition: transform .25s var(--spring);
}

.btn-submit:hover .btn-arrow {
  transform: translateX(4px);
}

/* Footer */
.card-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-dim);
}

/* ══════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  max-width: 340px;
  min-width: 220px;
  padding: 14px 20px;
  border-radius: 12px;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  color: #fff;
  background: #1E293B;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  opacity: 0;
  transform: translateY(14px) scale(.96);
  transition: opacity .35s var(--ease), transform .35s var(--spring);
  pointer-events: none;
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.toast-success { background: #14532D; border-color: rgba(34,197,94,.35); }
.toast-error   { background: #450A0A; border-color: rgba(239,68,68,.35); }

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */
@media (max-width: 900px) {
  body {
    flex-direction: column;
    overflow: auto;
  }

  .hero {
    min-height: 220px;
    max-height: 260px;
    width: 100%;
    flex: none;
    align-items: flex-end;
    justify-content: flex-start;
  }

  .hero-content {
    padding: 24px 24px 28px;
    max-width: 100%;
    animation: none;
  }

  .hero-badge { display: none; }
  .hero-brand { margin-bottom: 10px; }
  .hero-logo-icon { width: 38px; height: 38px; }
  .hero-logo-icon svg { width: 20px; height: 20px; }

  .hero-title {
    font-size: 34px;
    letter-spacing: -.5px;
  }

  .hero-subtitle { display: none; }
  .hero-stats { display: none; }
  .hero-features { display: none; }

  .auth-panel {
    width: 100%;
    min-height: auto;
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 32px 20px 40px;
    animation: none;
  }

  .auth-card {
    max-width: 400px;
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .auth-panel { padding: 24px 16px 36px; }
  .card-title { font-size: 22px; }
}
