/* ==========================================================================
   OLMED · Acceso al sistema (personal de la clínica)
   ========================================================================== */

.sys-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  background: var(--bg);
}

.sys-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 40px 44px;
  color: #f0fdfa;
  background:
    radial-gradient(520px 340px at 20% 10%, rgba(45, 212, 191, 0.35), transparent 65%),
    linear-gradient(160deg, #0b3b39, #08262a 70%);
  overflow: hidden;
}

.sys-brand::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(45, 212, 191, 0.12);
  filter: blur(10px);
}

.sys-brand img {
  height: 74px;
  width: auto;
  /* El SVG original es azul marino; en el acceso siempre se muestra blanco. */
  filter: brightness(0) invert(1);
}

.sys-brand h1 {
  position: relative;
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1.1;
  margin: 0 0 12px;
  color: #fff;
}

.sys-brand h1 em {
  font-family: var(--font-display);
  font-style: italic;
  color: #5eead4;
}

.sys-brand p {
  max-width: 34ch;
  color: rgba(240, 253, 250, 0.78);
  font-size: 0.95rem;
}

.sys-brand .sys-foot {
  position: relative;
  font-size: 0.8rem;
  color: rgba(240, 253, 250, 0.6);
}

.sys-panel {
  display: grid;
  place-items: center;
  padding: 40px 24px;
}

.login-card {
  --field-ring: rgba(13, 148, 136, 0.16);
  --field-icon: #8aa3a8;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 30px 26px;
}

.login-card h2 {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.login-card > p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 22px;
}

/* Campos del formulario ---------------------------------------------------
   El login no carga booking.css, así que aquí se definen sus propios
   controles: etiqueta pequeña, icono a la izquierda y foco con halo teal. */
.login-card .field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-card .field + .field {
  margin-top: 16px;
}

.login-card .field label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.login-card .control {
  position: relative;
  display: block;
}

.login-card .control-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--field-icon);
  transform: translateY(-50%);
  pointer-events: none;
  transition: color 0.18s ease;
}

.login-card .control-icon svg,
.login-card .password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-card .control input {
  width: 100%;
  min-height: 52px;
  padding: 15px 16px 15px 45px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  box-shadow: inset 0 1px 2px rgba(15, 61, 59, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.login-card .control input::placeholder {
  color: var(--muted);
  opacity: 0.62;
}

.login-card .control:hover input {
  border-color: var(--accent-line);
}

.login-card .control:focus-within .control-icon {
  color: var(--accent);
}

.login-card .control input:focus-visible {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: inset 0 1px 2px rgba(15, 61, 59, 0.04),
    0 0 0 4px var(--field-ring);
}

.login-card .control input.is-invalid {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.05);
}

.login-card .control input.is-invalid:focus-visible {
  border-color: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.16);
}

/* Autocompletado del navegador: conserva el diseño del campo */
.login-card .control input:-webkit-autofill,
.login-card .control input:-webkit-autofill:hover,
.login-card .control input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  box-shadow: 0 0 0 100px var(--accent-soft) inset;
  transition: background-color 9999s ease-out 0s;
}

.login-card .control input:-webkit-autofill:focus {
  box-shadow: 0 0 0 100px var(--accent-soft) inset,
    0 0 0 4px var(--field-ring);
}

/* Contraseña: botón con ojo dentro del campo */
.login-card .password-wrap input {
  padding-right: 56px;
}

.login-card .password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--field-icon);
  transform: translateY(-50%);
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease,
    box-shadow 0.18s ease;
}

.login-card .password-toggle:hover {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.login-card .password-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.login-card .password-toggle .icon-eye-off {
  display: none;
}

.login-card .password-toggle.is-visible .icon-eye {
  display: none;
}

.login-card .password-toggle.is-visible .icon-eye-off {
  display: block;
}

.login-card .btn {
  width: 100%;
  margin-top: 22px;
}

.login-card .login-error {
  margin-top: 14px;
  border-radius: 12px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  padding: 10px 12px;
  font-size: 0.85rem;
}

.login-card .login-error:empty {
  display: none;
}

.login-help {
  margin-top: 18px;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.login-help a {
  color: var(--accent);
  font-weight: 600;
}

:root[data-theme="dark"] .login-card {
  --field-ring: rgba(45, 212, 191, 0.22);
  --field-icon: #82a9a8;
}

:root[data-theme="dark"] .login-card .control input.is-invalid {
  border-color: #f87171;
  background: rgba(248, 113, 113, 0.08);
}

:root[data-theme="dark"] .login-card .login-error {
  background: #2b1414;
  border-color: #7f1d1d;
  color: #fecaca;
}

@media (max-width: 860px) {
  .sys-page {
    grid-template-columns: minmax(0, 1fr);
  }

  .sys-brand {
    padding: 26px 22px;
    gap: 14px;
  }

  .sys-brand img {
    height: 54px;
  }

  .sys-brand h1 {
    font-size: 1.9rem;
  }

  .sys-brand p,
  .sys-brand .sys-foot {
    display: none;
  }

  .sys-panel {
    padding: 26px 18px 44px;
    align-items: start;
  }
}
