:root {
  --navy-900: #0b1f3a;
  --navy-800: #11294b;
  --navy-700: #1a3a66;
  --primary: #1d5fd1;
  --primary-hover: #174fb0;
  --primary-soft: rgba(29, 95, 209, 0.12);
  --text: #1f2a37;
  --muted: #6b7686;
  --border: #d9dfe7;
  --bg: #f4f6fa;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --danger-border: #fecdca;
  --radius: 10px;
}

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

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.login {
  display: flex;
  min-height: 100vh;
}

/* ---------- Panel de marca ---------- */
.login-brand {
  position: relative;
  flex: 1 1 55%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 15%, rgba(29, 95, 209, 0.45), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(29, 95, 209, 0.25), transparent 40%),
    linear-gradient(160deg, var(--navy-700) 0%, var(--navy-800) 45%, var(--navy-900) 100%);
  overflow: hidden;
}

.login-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.login-brand > * {
  position: relative;
  z-index: 1;
}

.brand-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: #fff;
  padding: 6px;
  object-fit: contain;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.brand-sub {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.brand-body {
  max-width: 480px;
}

.brand-body h1 {
  font-size: 2.1rem;
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 14px;
}

.brand-body p {
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 0 32px;
}

.brand-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.brand-features li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
}

.brand-features i {
  flex: 0 0 38px;
  height: 38px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.95rem;
}

.brand-foot {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
}

/* ---------- Panel del formulario ---------- */
.login-panel {
  flex: 1 1 45%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: #fff;
}

.login-card {
  width: 100%;
  max-width: 400px;
}

.mobile-brand {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.mobile-brand .brand-logo {
  width: 48px;
  height: 48px;
  box-shadow: 0 2px 8px rgba(15, 35, 70, 0.12);
  border: 1px solid var(--border);
}

.mobile-brand .brand-name {
  color: var(--navy-900);
}

.mobile-brand .brand-sub {
  color: var(--muted);
}

.login-card h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy-900);
  margin: 0 0 6px;
}

.login-card .lead {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 28px;
}

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  margin-bottom: 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
}

.alert i {
  margin-top: 2px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--text);
}

.input-wrap {
  position: relative;
}

.input-wrap > i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #98a2b3;
  font-size: 0.9rem;
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 42px;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-wrap input::placeholder {
  color: #a7b0bd;
}

.input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.input-wrap:focus-within > i {
  color: var(--primary);
}

.toggle-pass {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #98a2b3;
  cursor: pointer;
}

.toggle-pass:hover,
.toggle-pass:focus-visible {
  color: var(--primary);
  background: var(--primary-soft);
  outline: none;
}

.btn-login {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.98rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(29, 95, 209, 0.25);
  transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
}

.btn-login:hover {
  background: var(--primary-hover);
}

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

.btn-login:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--primary-soft), 0 8px 20px rgba(29, 95, 209, 0.25);
}

.btn-login[disabled] {
  opacity: 0.8;
  cursor: wait;
}

.secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  font-size: 0.8rem;
  color: var(--muted);
}

.panel-foot {
  margin-top: 40px;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .login-brand {
    display: none;
  }

  .login-panel {
    background: var(--bg);
    justify-content: flex-start;
    padding-top: 56px;
  }

  .login-card {
    background: #fff;
    padding: 32px 28px;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(15, 35, 70, 0.08);
  }

  .mobile-brand {
    display: flex;
  }
}

@media (max-width: 480px) {
  .login-panel {
    padding: 24px 16px;
  }

  .login-card {
    padding: 26px 20px;
  }

  .login-card h2 {
    font-size: 1.4rem;
  }
}

@media (min-width: 1400px) {
  .login-brand {
    padding: 64px 80px;
  }

  .brand-body h1 {
    font-size: 2.5rem;
  }
}
