/* ══════════════════════════════════════════════════════════════
   LOGIN PAGE — Sanfer Volvo v2.0
   ══════════════════════════════════════════════════════════════ */

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

:root {
  --volvo-blue: #003057;
  --volvo-mid: #005287;
  --volvo-accent: #006cb7;
  --volvo-light: #e8f4f8;
  --text-dark: #0f172a;
  --text-mid: #475569;
  --text-light: #94a3b8;
  --white: #ffffff;
  --danger: #dc2626;
  --border: #e2e8f0;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

body {
  font-family: 'Montserrat', sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ──────────────────────────────────────────────────── */
.login-container {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}

/* ── Left Panel (Branding) ───────────────────────────────────── */
.login-left {
  flex: 0 0 45%;
  background: linear-gradient(160deg, #001a33 0%, var(--volvo-blue) 35%, var(--volvo-accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-left::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .05) 0%, transparent 70%);
  top: -120px;
  left: -150px;
  pointer-events: none;
}

.login-left::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(77, 184, 255, .06) 0%, transparent 70%);
  bottom: -80px;
  right: -80px;
  pointer-events: none;
}

.brand {
  width: 700px;
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--white);
  padding: 20px;
  animation: fadeUp .6s var(--ease) both;
}

.volvo-emblem {
  width: 100%;
  height: 270px;
  margin: 0 auto 24px;
  filter: drop-shadow(0 8px 32px rgba(0, 0, 0, .3));
}

.logo-sanfer {
  width: 100%;
}

.brand-tagline {
  font-size: 1.3rem;
  font-weight: 300;
  letter-spacing: .25em;
  opacity: .65;
  text-transform: uppercase;
}

/* ── Right Panel (Form) ──────────────────────────────────────── */
.login-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: #f8f9fc;
  position: relative;
}

.login-right::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--volvo-blue), var(--volvo-accent), #4db8ff);
}

.login-form-wrapper {
  width: 100%;
  max-width: 400px;
  animation: fadeUp .5s var(--ease) .1s both;
}

h2 {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.subtitle {
  color: var(--text-light);
  font-size: .88rem;
  margin-bottom: 36px;
  line-height: 1.5;
  font-weight: 500;
}

/* ── Form Fields ─────────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: .74rem;
  font-weight: 700;
  color: var(--text-mid);
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

input[type="text"],
input[type="password"],
input[type="email"] {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  color: var(--text-dark);
  background: var(--white);
  transition: border-color .2s, box-shadow .2s var(--ease);
  outline: none;
}

input:focus {
  border-color: var(--volvo-accent);
  box-shadow: 0 0 0 3px rgba(0, 108, 183, .1);
}

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 46px;
}

.toggle-pw {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .2s;
}

.toggle-pw svg {
  width: 18px;
  height: 18px;
}

.toggle-pw:hover {
  color: var(--volvo-accent);
}

/* ── Form Options ────────────────────────────────────────────── */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  margin-top: -4px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: .84rem;
  color: var(--text-mid);
  user-select: none;
  transition: color .2s;
  font-weight: 500;
}

.remember-me input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--volvo-accent);
}

.remember-me:hover {
  color: var(--volvo-accent);
}

/* ── Login Button ────────────────────────────────────────────── */
.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--volvo-blue), var(--volvo-accent));
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-family: 'Montserrat', sans-serif;
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .06em;
  cursor: pointer;
  margin-top: 8px;
  transition: all .2s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0, 48, 87, .25);
}

.btn-login:hover {
  box-shadow: 0 8px 28px rgba(0, 48, 87, .35);
  transform: translateY(-2px);
}

.btn-login:active {
  transform: translateY(0);
}

.btn-login:disabled {
  opacity: .65;
  cursor: not-allowed;
  transform: none;
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  animation: spin .8s linear infinite;
  stroke: white;
  stroke-dasharray: 80;
  stroke-dashoffset: 60;
}

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

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.hidden {
  display: none !important;
}

/* ── Error / Info Messages ───────────────────────────────────── */
.error-msg {
  background: #fff5f5;
  border: 1px solid #fecaca;
  color: var(--danger);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: .84rem;
  font-weight: 600;
  margin-bottom: 20px;
  text-align: center;
}

/* ══════════════════════════════════════════════════════════════
   MODULE SELECTOR MODAL
   ══════════════════════════════════════════════════════════════ */
.module-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 20, 45, .6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease);
}

.module-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.module-modal {
  background: #fff;
  border-radius: 22px;
  padding: 48px 52px;
  width: 100%;
  max-width: 720px;
  box-shadow: 0 32px 80px rgba(0, 30, 87, .2), 0 0 0 1px rgba(0, 0, 0, .05);
  transform: translateY(20px) scale(.97);
  transition: transform .35s cubic-bezier(.22, 1, .36, 1);
  text-align: center;
}

.module-overlay.visible .module-modal {
  transform: translateY(0) scale(1);
}

.module-modal-greeting {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--volvo-accent);
  margin-bottom: 6px;
}

.module-modal h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.module-modal p {
  color: var(--text-light);
  font-size: .86rem;
  margin-bottom: 36px;
  font-weight: 500;
}

/* Module Cards */
.module-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.module-cards.two-cards {
  grid-template-columns: repeat(2, 1fr);
  max-width: 460px;
  margin: 0 auto;
}

.module-card {
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 24px 18px;
  cursor: pointer;
  transition: all .25s var(--ease);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: #fafaff;
}

.module-card:hover {
  border-color: var(--volvo-accent);
  box-shadow: 0 8px 32px rgba(0, 108, 183, .12);
  transform: translateY(-4px);
  background: #fff;
}

.module-card:active {
  transform: translateY(-1px);
}

.module-card-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.module-card-icon.ventas {
  background: linear-gradient(135deg, #003057, #006cb7);
  color: #fff;
}

.module-card-icon.alquileres {
  background: linear-gradient(135deg, #1a5276, #2471a3);
  color: #fff;
}

.module-card-icon.depreciacion {
  background: linear-gradient(135deg, #4a1d96, #7c3aed);
  color: #fff;
}

.module-card span {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: .03em;
}

.module-card small {
  font-size: .72rem;
  color: var(--text-light);
  margin-top: -6px;
  font-weight: 500;
}

.module-badge-new {
  background: #ecfdf5;
  color: #15803d;
  border: 1px solid #a7f3d0;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: -4px;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .login-container {
    flex-direction: column;
  }

  .login-left {
    flex: 0 0 auto;
    width: 100%;
    padding: 40px 20px;
  }

  .login-left::before,
  .login-left::after {
    display: none;
  }

  .brand {
    width: 100%;
    max-width: 340px;
  }

  .volvo-emblem {
    width: 280px;
    height: auto;
    margin-bottom: 16px;
  }

  .brand-tagline {
    font-size: .8rem;
  }

  .login-right {
    flex: 1;
    padding: 40px 24px;
    align-items: flex-start;
    padding-top: 60px;
  }

  .login-right::before {
    display: none;
  }

  .login-form-wrapper {
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .login-right {
    padding: 30px 20px;
  }

  h2 {
    font-size: 1.5rem;
  }

  .subtitle {
    font-size: .84rem;
    margin-bottom: 28px;
  }

  .btn-login {
    padding: 13px;
  }

  .module-modal {
    padding: 32px 20px;
  }

  .module-cards {
    grid-template-columns: 1fr !important;
  }

  .logo-sanfer {
    width: 100%;
  }
}