/* ============================================
   LOGIN.CSS — Sin Bootstrap, 100% responsive
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700&family=DM+Sans:wght@400;500;600&display=swap');

:root {
  --green:      #a4c639;
  --green-dark: #8fb02a;
  --card-bg:    rgba(30, 60, 42, 0.85);
  --input-bg:   rgba(255,255,255,0.97);
  --radius:     16px;
  --transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
}

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

html, body { height: 100%; }

body {
  min-height: 100vh;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  display:         flex !important;
  flex-direction:  column !important;
  align-items:     center !important;
  justify-content: center !important;
  padding:    28px 16px;
  overflow-y: auto;
  position:   relative;
}

/* ── FONDO ── */
.bg-overlay {
  position: fixed;
  inset: 0;
  background-image: url('../img/img_fondo.jpg');
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.bg-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.50);
  backdrop-filter: blur(3px);
}
.bg-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 20%, rgba(0,0,0,0.35) 100%);
}

/* ── WRAPPER ── */
.login-wrapper {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;                  /* ↓ antes 20px */
  width: 100%;
  max-width: 360px;           /* ↓ antes 420px */
}

/* ── LOGO ── */
.login-logo { text-align: center; animation: fadeDown 0.7s ease-out; }
.login-logo img {
  height: 110px;              /* ✅ más grande en desktop */
  width: auto;
  display: block;
  margin: 0 auto;
  filter: brightness(0) invert(1) drop-shadow(0 4px 14px rgba(0,0,0,0.55));
  transition: var(--transition);
}
.login-logo img:hover { transform: scale(1.04); }

/* ── CARD ── */
.login-card {
  width: 100%;
  background: var(--card-bg);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(100,140,110,0.45);
  border-radius: 22px;
  padding: 28px 26px 22px;    /* ↓ antes 36px 32px 28px */
  box-shadow:
    0 12px 40px rgba(0,0,0,0.45),
    inset 0 0 0 1px rgba(255,255,255,0.12);
  animation: fadeUp 0.6s cubic-bezier(0.16,1,0.3,1);
}

/* ── TÍTULO ── */
.login-title {
  font-family: 'Sora', sans-serif;
  font-size: 22px;            /* ↓ antes 26px */
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin-bottom: 18px;        /* ↓ antes 24px */
  letter-spacing: -0.02em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

/* ── FORM ── */
form { display: flex; flex-direction: column; gap: 11px; } /* ↓ antes 14px */

/* ── INPUT GROUP ── */
.input-group { position: relative; display: flex; align-items: center; }

.input-icon {
  position: absolute;
  left: 14px;
  color: rgba(30,60,42,0.45);
  font-size: 14px;
  pointer-events: none;
  z-index: 2;
}

.input-group input {
  width: 100%;
  padding: 13px 42px;         /* ↓ antes 15px 44px */
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  color: #111;
  background: var(--input-bg);
  outline: none;
  transition: var(--transition);
  -webkit-appearance: none;
}
.input-group input::placeholder { color: rgba(30,30,30,0.40); font-weight: 400; }
.input-group input:focus {
  border-color: rgba(164,198,57,0.65);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(164,198,57,0.14);
  transform: translateY(-1px);
}

.toggle-eye {
  position: absolute;
  right: 11px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(30,30,30,0.38);
  font-size: 15px;
  padding: 5px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  transition: var(--transition);
  z-index: 2;
}
.toggle-eye:hover { color: rgba(30,30,30,0.70); background: rgba(0,0,0,0.06); }

/* ── BOTÓN ── */
.btn-login {
  width: 100%;
  padding: 13px 22px;         /* ↓ antes 15px 24px */
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;            /* ↓ antes 15px */
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(164,198,57,0.38);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.btn-login:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(164,198,57,0.48);
}
.btn-login:active { transform: translateY(0); }

.btn-login.loading .btn-text { opacity: 0.6; }
.btn-login.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

/* ── VERSIÓN ── */
.app-version {
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  font-family: 'Sora', monospace;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  background: rgba(0,0,0,0.28);
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
}

/* ── SWEETALERT2 ── */
.swal-login-popup {
  border-radius: 20px !important;
  border: 1px solid rgba(100,140,110,0.35) !important;
  font-family: 'DM Sans', sans-serif !important;
}
.swal-login-btn {
  border-radius: 12px !important;
  font-weight: 600 !important;
  font-family: 'DM Sans', sans-serif !important;
  padding: 10px 28px !important;
}

/* ── ANIMACIONES ── */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */

@media (max-width: 768px) {
  body { padding: 24px 18px; }
  .login-wrapper { gap: 14px; max-width: 380px; }
  .login-logo img { height: 95px; }
  .login-card { padding: 26px 22px 20px; }
  .login-title { font-size: 21px; }
}

@media (max-width: 500px) {
  body { padding: 20px 14px; }
  .login-wrapper { gap: 12px; max-width: 100%; }
  .login-logo img { height: 80px; }
  .login-card {
    padding: 22px 18px 18px;
    border-radius: 18px;
    width: calc(100vw - 28px);
  }
  .login-title { font-size: 19px; margin-bottom: 14px; }
  form { gap: 10px; }
  .input-group input { padding: 12px 40px; font-size: 15px; }
  .btn-login { padding: 12px; font-size: 13px; }
}

@media (max-width: 380px) {
  body { padding: 16px 12px; }
  .login-wrapper { gap: 10px; }
  .login-logo img { height: 70px; }
  .login-card {
    padding: 18px 14px 16px;
    border-radius: 16px;
    width: calc(100vw - 24px);
  }
  .login-title { font-size: 18px; margin-bottom: 12px; }
  .input-group input { padding: 11px 38px; font-size: 15px; }
  .btn-login { padding: 11px; font-size: 13px; }
  .app-version { font-size: 9px; }
}

@media (hover: none) and (pointer: coarse) {
  .btn-login:hover  { transform: none; }
  .btn-login:active { transform: scale(0.98); }
  .login-logo img:hover { transform: none; }
}