:root {
  --ink: #0f172a;
  --muted: #64748b;
  --accent: #e8a317;
  --accent-deep: #c9890f;
  --brand-blue: #1a4f9c;
  --brand-navy: #0b1f3f;
  --focus: #3b82f6;
  --line: #e2e8f0;
  --surface: #ffffff;
  --danger: #be123c;
  --danger-bg: #fff1f2;
  --shell-radius: 36px;
  --field-radius: 12px;
  --font-display: "Instrument Sans", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body.login-page {
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(232, 163, 23, 0.18), transparent 55%),
    radial-gradient(ellipse 90% 70% at 20% 80%, rgba(26, 79, 156, 0.55), transparent 50%),
    radial-gradient(circle at 50% 40%, #163a7a 0%, var(--brand-navy) 55%, #061224 100%);
  display: grid;
  place-items: center;
  padding: 24px 16px;
  -webkit-font-smoothing: antialiased;
}

.login-shell {
  width: min(1040px, 100%);
  min-height: min(620px, calc(100vh - 48px));
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: var(--shell-radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow:
    0 40px 80px -20px rgba(0, 0, 0, 0.55),
    0 16px 32px -12px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  animation: shell-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes shell-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ——— Formulario ——— */
.login-form-pane {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 44px 28px;
  background: var(--surface);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #0a0a0a;
  box-shadow: 0 0 0 2px rgba(232, 163, 23, 0.35);
  flex-shrink: 0;
}

.brand-copy {
  min-width: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
  margin: 0;
}

.brand-tag {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.login-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.65rem, 2.4vw, 1.95rem);
  letter-spacing: -0.03em;
  margin: 0 0 8px;
  color: var(--ink);
  line-height: 1.15;
}

.login-lead {
  margin: 0 0 26px;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--muted);
  max-width: 34ch;
}

.login-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecdd3;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 18px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.field-control {
  position: relative;
  display: flex;
  align-items: center;
}

.field-control .icon-left {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: #94a3b8;
  pointer-events: none;
  display: flex;
}

.field-control .icon-left svg {
  width: 18px;
  height: 18px;
}

.field-control input {
  width: 100%;
  height: 48px;
  padding: 0 44px;
  border: 1.5px solid var(--line);
  border-radius: var(--field-radius);
  background: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  transition: border-color 0.18s, box-shadow 0.18s;
}

.field-control input::placeholder {
  color: #94a3b8;
}

.field-control input:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

.btn-toggle-pass {
  position: absolute;
  right: 8px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: #94a3b8;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.btn-toggle-pass:hover {
  color: var(--ink);
  background: #f1f5f9;
}

.btn-toggle-pass svg {
  width: 18px;
  height: 18px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 20px;
  flex-wrap: wrap;
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

.remember input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-blue);
  cursor: pointer;
}

.link-forgot {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-blue);
  text-decoration: none;
}

.link-forgot:hover {
  text-decoration: underline;
}

.btn-submit {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: #111;
  background: linear-gradient(180deg, #f0b42e 0%, var(--accent) 45%, var(--accent-deep) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 8px 20px -6px rgba(232, 163, 23, 0.55);
  transition: transform 0.15s, filter 0.15s, box-shadow 0.15s;
}

.btn-submit:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 12px 24px -6px rgba(232, 163, 23, 0.6);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-install {
  display: none;
  width: 100%;
  height: 42px;
  margin-top: 10px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--brand-blue);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s, border-color 0.15s;
}

.btn-install.is-visible {
  display: inline-flex;
}

.btn-install:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-install svg {
  width: 16px;
  height: 16px;
}

.login-copy {
  margin-top: auto;
  padding-top: 28px;
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.4;
}

/* ——— Panel de marca ——— */
.login-brand-pane {
  position: relative;
  min-height: 100%;
  background:
    #0b1f3f
    url("../../img/cafe.jpg") center / cover no-repeat;
  overflow: hidden;
  animation: brand-fade 0.7s ease 0.12s both;
}

@keyframes brand-fade {
  from {
    opacity: 0.65;
  }
  to {
    opacity: 1;
  }
}

.login-brand-pane::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 18, 36, 0.15) 0%, rgba(6, 18, 36, 0.35) 40%, rgba(6, 18, 36, 0.88) 100%),
    linear-gradient(90deg, rgba(11, 31, 63, 0.25), transparent 40%);
  pointer-events: none;
}

.brand-panel-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 28px 32px 32px;
  color: #fff;
}

.brand-eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 10px;
}

.brand-headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.45rem, 2.2vw, 1.85rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 16px;
  max-width: 16ch;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.brand-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.brand-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
}

/* Modal olvidé contraseña */
.login-modal[hidden] {
  display: none !important;
}

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(6, 18, 36, 0.55);
  backdrop-filter: blur(4px);
}

.login-modal-card {
  width: min(380px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
}

.login-modal-card h3 {
  font-family: var(--font-display);
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.login-modal-card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.login-modal-card button {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: var(--brand-blue);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}

@media (max-width: 900px) {
  body.login-page {
    padding: 12px;
    align-items: stretch;
  }

  .login-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    min-height: auto;
    border-radius: 28px;
  }

  .login-brand-pane {
    order: -1;
    min-height: 180px;
    max-height: 200px;
  }

  .brand-panel-content {
    padding: 18px 20px 20px;
  }

  .brand-headline {
    font-size: 1.25rem;
    margin-bottom: 10px;
    max-width: none;
  }

  .login-form-pane {
    padding: 28px 22px 22px;
  }

  .login-lead {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-shell,
  .login-brand-pane {
    animation: none;
  }
}
