@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --navy-900: #0B2A3C;
  --navy-800: #0F3A52;
  --petrol: #14506A;
  --cyan: #0EA5D3;
  --cyan-600: #0A84AA;   /* fondo del botón: contraste AA con texto blanco */
  --cyan-700: #08708F;
  --ink: #0F1E2A;
  --ink-2: #3D4F5C;
  --muted: #5F707D;
  --line: #D5DEE5;
  --line-strong: #B7C4CE;
  --field: #F7FAFC;
  --danger: #C2362B;
  --danger-bg: #FDF1F0;
  --info-bg: #ECF7FC;
  --radius: 10px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #F4F7F9; }

.wordmark { font-size: 20px; font-weight: 400; letter-spacing: -.01em; }
.wordmark b { font-weight: 700; }

/* ---------- Login: dos zonas ---------- */
body.login {
  display: grid; grid-template-columns: minmax(380px, 46%) 1fr;
  min-height: 100vh; background: #fff;
}

.side {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
  padding: 48px clamp(32px, 5vw, 72px);
  color: #fff;
  /* Foto: Josh Hild, Pexels 30899220 (licencia libre) */
  background:
    linear-gradient(180deg, rgba(11, 42, 60, .40) 0%, rgba(11, 42, 60, .60) 50%, rgba(11, 42, 60, .92) 100%),
    linear-gradient(90deg, rgba(11, 42, 60, .45), rgba(11, 42, 60, 0)),
    url("/img/fondo-rascacielos.jpg") center / cover no-repeat, var(--navy-900);
}
.side-brand { display: flex; align-items: center; gap: 12px; }
.side-brand .wordmark b { color: #6FD3F2; }
.side-copy { max-width: 520px; }
.side-copy h2 {
  margin: 0 0 16px; font-size: clamp(30px, 3.2vw, 42px); line-height: 1.12;
  font-weight: 650; letter-spacing: -.025em; text-wrap: balance;
}
.side-copy p { margin: 0; font-size: 16px; line-height: 1.6; color: #B9D3E0; }

.panel { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.form-wrap { width: 100%; max-width: 400px; margin: auto 0; }
.form-head { margin-bottom: 32px; }
.form-head h1 { margin: 0 0 8px; font-size: 30px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.form-head p { margin: 0; font-size: 15px; color: var(--muted); }

form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 14px; font-weight: 600; color: var(--ink-2); }

.control { position: relative; }
.control .ico {
  position: absolute; left: 14px; top: 50%; translate: 0 -50%;
  width: 18px; height: 18px; fill: none; stroke: #8A9AA6; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; pointer-events: none; transition: stroke .15s;
}
.control input {
  width: 100%; height: 48px; padding: 0 14px 0 44px;
  font: inherit; font-size: 15px; color: var(--ink);
  background: var(--field); border: 1px solid var(--line); border-radius: var(--radius);
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.control input#pass { padding-right: 48px; }
.control input:hover { border-color: var(--line-strong); }
.control input:focus { background: #fff; border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(14, 165, 211, .15); }
.control:focus-within .ico { stroke: var(--cyan-600); }
.control input[aria-invalid="true"] { border-color: var(--danger); background: #fff; }
.control input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px rgba(194, 54, 43, .12); }
.control input:disabled { background: #EEF2F5; color: var(--muted); cursor: not-allowed; }

.eye {
  position: absolute; right: 6px; top: 50%; translate: 0 -50%;
  display: grid; place-items: center; width: 36px; height: 36px;
  border: 0; border-radius: 8px; background: none; cursor: pointer; color: #6B7C88;
}
.eye:hover { background: #EAF0F4; color: var(--ink-2); }
.eye:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
.eye svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.eye .eye-off, .eye[aria-pressed="true"] .eye-on { display: none; }
.eye[aria-pressed="true"] .eye-off { display: block; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: -4px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--cyan-600); cursor: pointer; }
.link { font-size: 14px; font-weight: 500; color: var(--cyan-700); text-decoration: none; border-radius: 4px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.msg { margin: 0; font-size: 14px; line-height: 1.45; border-radius: 8px; }
.msg:empty { display: none; }
.msg[data-kind="error"] { padding: 10px 12px; color: var(--danger); background: var(--danger-bg); border: 1px solid #F3CFCB; }
.msg[data-kind="info"] { padding: 10px 12px; color: var(--petrol); background: var(--info-bg); border: 1px solid #CDE9F5; }

.primary {
  position: relative; height: 48px; margin-top: 4px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: inherit; font-size: 15px; font-weight: 600; color: #fff;
  background: var(--cyan-600); border: 0; border-radius: var(--radius); cursor: pointer;
  box-shadow: 0 1px 2px rgba(11, 42, 60, .12); transition: background .15s, box-shadow .15s;
}
.primary:hover { background: var(--cyan-700); box-shadow: 0 4px 14px rgba(10, 132, 170, .25); }
.primary:focus-visible { outline: 3px solid rgba(14, 165, 211, .45); outline-offset: 2px; }
.primary:disabled { background: #8FB9C9; box-shadow: none; cursor: progress; }
.spinner {
  display: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .7s linear infinite;
}
form.busy .spinner { display: block; }
@keyframes spin { to { rotate: 360deg; } }

.secure { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; font-size: 13px; color: var(--muted); }

.side .by { display: grid; justify-items: start; gap: 12px; }
.side .by span { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #9CBCCC; }
.side .by img { width: 200px; height: auto; opacity: .9; }
.mobile-by { display: none; justify-items: center; gap: 10px; margin-top: 40px; }
.mobile-by span { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #7D8C97; }
.mobile-by img { width: 180px; height: auto; }

/* Tablet: el panel corporativo se estrecha */
@media (max-width: 1080px) {
  body.login { grid-template-columns: 40% 1fr; }
  .side-copy p { font-size: 15px; }
}
/* Móvil: el panel corporativo pasa a ser una cabecera compacta */
@media (max-width: 820px) {
  body.login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { gap: 20px; padding: 24px 20px 28px; }
  .side-copy h2 { font-size: 24px; margin-bottom: 0; }
  .side-copy h2 br { display: none; }
  .side-copy p, .side .by { display: none; }
  .mobile-by { display: grid; }
  .panel { flex-direction: column; justify-content: space-between; padding: 32px 20px 24px; }
  .form-head { margin-bottom: 24px; }
  .form-head h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation-duration: 0s !important; } }

/* ---------- Zona privada ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--line);
}
.top .brand { display: flex; align-items: center; gap: 10px; color: var(--navy-900); }
.top .brand b { color: var(--cyan-600); }
.top button {
  font: inherit; font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 8px; cursor: pointer;
  color: var(--ink-2); background: #fff; border: 1px solid var(--line); white-space: nowrap;
}
.top button:hover { background: #F4F7F9; }
.wrap { max-width: 900px; margin: 48px auto; padding: 0 16px; }
.wrap h1 { color: var(--navy-900); font-weight: 700; letter-spacing: -.02em; }
.wrap p { color: var(--muted); }
@media (max-width: 480px) {
  .top { padding: 10px 16px; }
  .top .wordmark { font-size: 17px; }
}
