/* Login Clínica Manantiales (PWA + acceso rápido) */

* { box-sizing: border-box; }

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

body.login-body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
}

/* Fondo de marca como capa fija (no afecta al flujo del formulario) */
body.login-body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("../image/clinicamanantiales.gif") no-repeat center center / cover;
  opacity: 0.16;
  z-index: 0;
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
  padding: 28px 26px 22px;
}

.login-logo {
  text-align: center;
  margin: 0 auto 18px;
}

.login-logo img {
  max-width: 190px;
  height: auto;
}

.login-card .alert {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.alert-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* Botón principal: acceso rápido con passkey */
.btn-acceso-rapido {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.28);
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-acceso-rapido:hover { background: #1e40af; }
.btn-acceso-rapido:active { transform: translateY(1px); }
.btn-acceso-rapido:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

.acceso-rapido-sub {
  text-align: center;
  font-size: 11.5px;
  color: #64748b;
  margin: 7px 0 2px;
}

.passkey-msg {
  margin: 8px auto 2px;
  font-size: 12.5px;
  color: #b45309;
  text-align: center;
}

.login-separador {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #94a3b8;
  font-size: 12px;
  margin: 16px 0 14px;
}

.login-separador::before,
.login-separador::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.form-group { margin-bottom: 13px; }
.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 5px;
}

.input-group { display: flex; align-items: stretch; }
.input-group-addon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-right: 0;
  border-radius: 9px 0 0 9px;
  color: #64748b;
}

.form-control {
  flex: 1;
  min-width: 0;
  height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 0 9px 9px 0;
  padding: 0 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.btn-ingresar {
  display: block;
  width: 100%;
  min-height: 42px;
  border: 1px solid #0f172a;
  border-radius: 10px;
  background: #0f172a;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s ease;
}

.btn-ingresar:hover { background: #1e293b; }

.btn-crear-acceso {
  display: block;
  width: 100%;
  min-height: 38px;
  margin-top: 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 9px;
  background: #ffffff;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.btn-crear-acceso:hover { border-color: #1d4ed8; color: #1d4ed8; }
.btn-crear-acceso:disabled { color: #94a3b8; cursor: default; border-style: solid; }

.crear-acceso-msg {
  margin-top: 8px;
  font-size: 12px;
  color: #64748b;
  text-align: center;
}

.crear-acceso-sub {
  margin-top: 7px;
  font-size: 11.5px;
  color: #64748b;
  text-align: center;
}

/* El atributo hidden debe ganarle al display:block de los botones. */
.btn-crear-acceso[hidden],
.crear-acceso-sub[hidden],
.crear-acceso-msg[hidden] {
  display: none !important;
}

/* Overlay instrucciones iOS */
.pwa-ios-overlay,
.pwa-activar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 18px;
}

.pwa-ios-overlay.activo,
.pwa-activar-overlay.activo {
  display: flex;
}

.pwa-ios-box,
.pwa-activar-box {
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.3);
}

.pwa-ios-box h3,
.pwa-activar-box h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.pwa-ios-box ol {
  margin: 0 0 10px;
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.65;
  color: #334155;
}

.pwa-ios-box p,
.pwa-activar-desc {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.5;
  margin: 0 0 12px;
}

.pwa-ios-cerrar {
  display: block;
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: #0f172a;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.pwa-activar-box label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 5px;
}

.pwa-activar-box input[type="text"] {
  width: 100%;
  height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 11px;
  font-size: 14px;
  font-family: inherit;
}

.pwa-activar-acciones {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.pwa-activar-si {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: #16a34a;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.pwa-activar-no {
  flex: 1;
  min-height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  color: #334155;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 520px) {
  body.login-body { padding: 12px; align-items: flex-start; }
  .login-card { padding: 20px 16px 16px; border-radius: 14px; }
  .btn-acceso-rapido { min-height: 44px; }
}
