/* ============================================================================
   SYSTEMS JJ — Login. Tema "Odoo-like" (púrpura #714B67).
   ========================================================================== */
:root {
  --odo: #714b67;
  --odo-dark: #5a3b52;
  --odo-deeper: #4e3548;
  --odo-soft: #f6f0f4;
  --teal: #00a09d;
  --navy: #282c34;
  --muted: #8a94a6;
  --line: #e8e8ec;
  --blue: #4f7cff;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--navy);
  background: #f6f6f8;
}
.auth-split { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }

/* ===== Left brand panel ===== */
.brand-panel {
  position: relative; color: #fff; padding: 56px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  background: linear-gradient(155deg, #4e3548 0%, #714b67 55%, #9b6a8d 120%); overflow: hidden;
}
.brand-panel::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(620px 420px at 18% 0%, rgba(255,255,255,.18), transparent 60%); pointer-events: none; }
.brand-panel .top { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.brand-panel .top img {
  width: 240px; height: auto; display: block; margin-bottom: 30px;
  filter: drop-shadow(0 8px 22px rgba(0,0,0,.35));
}
.brand-panel .tag { font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: #e8d4e0; position: relative; z-index: 1; margin-bottom: 12px; }
.brand-panel h1 { font-size: 30px; margin: 0 0 8px; letter-spacing: -0.5px; line-height: 1.25; position: relative; z-index: 1; }
.brand-panel ul { list-style: none; margin: 26px 0 0; padding: 0; position: relative; z-index: 1; }
.brand-panel ul li { display: flex; gap: 12px; align-items: center; justify-content: center; margin-bottom: 14px; font-size: 15px; color: #f4e6ee; }
.brand-panel ul li .ic { width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 14px; flex: 0 0 auto; }
.brand-panel .foot { position: absolute; bottom: 40px; left: 0; right: 0; text-align: center; z-index: 1; font-size: 13px; color: #d9bcd0; }

/* ===== Right form panel ===== */
.form-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.auth-card { width: 100%; max-width: 420px; }
.back { display: inline-block; margin-bottom: 28px; font-size: 13px; font-weight: 600; color: var(--muted); }
.back:hover { color: var(--odo); }
.auth-card h2 { font-size: 28px; margin: 0 0 6px; letter-spacing: -0.5px; }
.auth-card .sub { color: var(--muted); margin: 0 0 28px; font-size: 15px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: #3a3f47; margin-bottom: 7px; }
.input-row { position: relative; }
.input-row input {
  width: 100%; padding: 13px 46px 13px 14px; border-radius: 10px; border: 1px solid #d5d9e0;
  background: #fff; color: var(--navy); font-size: 15px; transition: .15s ease;
}
.input-row input:focus { outline: none; border-color: var(--odo); box-shadow: 0 0 0 3px rgba(113,75,103,.14); }
.toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer; font-size: 15px; color: var(--muted); }
button.btn {
  width: 100%; padding: 13px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--odo); color: #fff; font-weight: 700; font-size: 15px;
  box-shadow: 0 10px 22px rgba(113,75,103,.28); transition: .18s ease;
}
button.btn:hover { background: var(--odo-dark); transform: translateY(-1px); }
button.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.msg { margin: 12px 0 0; font-size: 13px; min-height: 18px; }
.msg.ok { color: #1daf6e; }
.msg.err { color: #dc3545; }
.hint { margin-top: 22px; font-size: 12px; color: var(--muted); text-align: center; }
[hidden] { display: none !important; }

/* ===== Fila: recordar / olvidé ===== */
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 4px; }
.remember { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--navy); cursor: pointer; font-weight: 500; }
.remember input { width: 16px; height: 16px; accent-color: var(--odo); cursor: pointer; margin: 0; }
.link { color: var(--odo); font-weight: 600; font-size: 13px; cursor: pointer; background: none; border: 0; padding: 0; text-decoration: none; }
.link:hover { color: var(--odo-dark); text-decoration: underline; }

/* ===== Divisor "o" ===== */
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ===== Botón Gmail (logo de Google + Gmail, estilo oficial) ===== */
.btn.google {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; height: 44px; padding: 0 12px;
  background: #fff; color: #3c4043;
  border: 1px solid #dadce0; border-radius: 4px;
  font-family: "Roboto", "Segoe UI", Arial, sans-serif;
  font-size: 14px; font-weight: 500; letter-spacing: 0.25px;
  text-decoration: none; text-transform: none; box-shadow: none; cursor: pointer;
  transition: background-color 0.218s, border-color 0.218s, box-shadow 0.218s;
}
.btn.google:hover {
  background: #f8f9fa; transform: none;
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}
.btn.google:active { background: #f1f3f4; }
.btn.google svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn.google span { white-space: nowrap; }

/* ===== Selects y registro ===== */
.field select {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid #d5d9e0;
  background: #fff; color: var(--navy); font-size: 15px; font-family: inherit; cursor: pointer;
  transition: 0.15s ease;
}
.field select:focus { outline: none; border-color: var(--odo); box-shadow: 0 0 0 3px rgba(113,75,103,.14); }
.req { color: #dc3545; }
.reg-note {
  font-size: 12.5px; line-height: 1.5; color: var(--odo-deeper);
  background: var(--odo-soft); border: 1px solid #eadde6;
  border-radius: 8px; padding: 10px 12px; margin: 6px 0 10px;
}
#reg-company[hidden] { display: none !important; }

/* ===== Vista de registro de cliente (panel derecho) ===== */
.form-panel { overflow-y: auto; align-items: flex-start; }
.auth-card { padding: 56px 0 40px; transition: max-width .2s ease; }
.auth-card.wide { max-width: 860px; }
.reg-layout { display: grid; grid-template-columns: 3fr 1fr; gap: 26px; align-items: start; }
.reg-form-col { min-width: 0; }
.reg-section { margin-bottom: 20px; }
.reg-section h3 {
  margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--odo);
  border-bottom: 1px solid var(--line); padding-bottom: 8px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.field input.invalid, .field select.invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, .12);
}
.pass-hint { margin: 5px 0 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.back-login-hint { margin-top: 16px; font-size: 13px; color: var(--muted); text-align: center; }

/* ===== Columna multimedia: logotipo / avatar ===== */
.reg-media-col { display: flex; flex-direction: column; gap: 10px; }
.logo-drop {
  display: block; cursor: pointer;
  border: 1.5px dashed #d5d9e0; border-radius: 14px;
  background: #f6f6f8; aspect-ratio: 1 / 1;
  display: grid; place-items: center; padding: 14px;
  transition: border-color .15s ease, background .15s ease;
}
.logo-drop:hover { border-color: var(--odo); background: var(--odo-soft); }
.logo-preview { width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; }
.logo-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); position: relative; text-align: center; }
.logo-plus-badge {
  position: absolute; top: 6px; right: -14px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--odo); color: #fff; font-size: 14px; font-weight: 700;
  display: grid; place-items: center; line-height: 1;
}
.logo-hint { font-size: 12px; font-weight: 600; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.logo-actions { display: flex; gap: 8px; }
.logo-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 10px; border-radius: 8px; border: 1px solid #d5d9e0;
  background: #fff; color: #3a3f47; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: .15s ease;
}
.logo-btn:hover { border-color: var(--odo); color: var(--odo); background: var(--odo-soft); }
.logo-btn.danger:hover { border-color: #dc3545; color: #dc3545; background: #fdecee; }
.logo-note { margin: 0; font-size: 11.5px; color: var(--muted); text-align: center; }

/* ===== Barra de acciones (pie del formulario) ===== */
.reg-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.reg-actions .btn { width: auto; min-width: 170px; }
.btn-teal-outline {
  background: #fff; color: var(--teal);
  border: 1.5px solid var(--teal); box-shadow: none;
  padding: 11px 18px; font-weight: 700;
}
.btn-teal-outline:hover { background: rgba(0,160,157,.08); transform: none; }

@media (max-width: 820px) {
  .reg-layout { grid-template-columns: 1fr; }
  .reg-media-col { order: -1; max-width: 320px; }
  .reg-actions { flex-direction: column-reverse; align-items: stretch; }
  .reg-actions .btn { width: 100%; }
}
@media (max-width: 480px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* ===== Registro ===== */
.register-hint { margin-top: 20px; font-size: 13px; color: var(--muted); text-align: center; }

/* ===== Modales ===== */
.modal-backdrop { position: fixed; inset: 0; background: rgba(40,44,52,.5); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop[hidden] { display: none; }
.modal { background: #fff; border-radius: 14px; box-shadow: 0 18px 48px rgba(40,44,52,.16); width: 100%; max-width: 420px; max-height: 92vh; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 17px; }
.modal-close { background: none; border: 0; cursor: pointer; color: var(--muted); width: 30px; height: 30px; border-radius: 8px; font-size: 18px; display: grid; place-items: center; }
.modal-close:hover { background: #f1f1f3; color: var(--navy); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-sub { margin: 0 0 16px; font-size: 13.5px; color: var(--muted); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); background: #fafafa; border-radius: 0 0 14px 14px; }
.modal-foot .btn { width: auto; }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { background: #f6f6f8; transform: none; }

@media (max-width: 820px) {
  .auth-split { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .form-panel { min-height: 100vh; }
}
