/* ==========================================================================
   YERAYFH - MODAL DE ACCESO Y SEGURIDAD CLÍNICA
   ========================================================================== */

:root {
  --auth-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --auth-primary: #38bdf8;
  --auth-primary-hover: #0284c7;
  --auth-bg-overlay: rgba(6, 9, 13, 0.88);
  --auth-modal-bg: #0f1722;
  --auth-modal-border: #1e293b;
  --auth-text-main: #f8fafc;
  --auth-text-muted: #94a3b8;
  --auth-input-bg: #090d14;
  --auth-input-border: #1e293b;
  --auth-danger: #ef4444;
  --auth-success: #10b981;
  --auth-radius: 12px;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--auth-bg-overlay);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 1.25rem;
  animation: authFadeIn 0.25s ease-out;
}

@keyframes authFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.auth-card {
  font-family: var(--auth-font);
  background: var(--auth-modal-bg);
  border: 1px solid var(--auth-modal-border);
  border-radius: var(--auth-radius);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  max-width: 440px;
  width: 100%;
  padding: 2.25rem 2rem;
  color: var(--auth-text-main);
  position: relative;
}

.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-brand-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 1.1rem;
}

.auth-logo-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 12px;
  background: #ffffff;
  padding: 5px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  border: 1.5px solid var(--auth-modal-border);
}

.auth-icon-badge {
  width: 52px;
  height: 52px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--auth-primary);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.auth-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--auth-text-main);
}

.auth-header p {
  font-size: 0.85rem;
  color: var(--auth-text-muted);
  line-height: 1.45;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
}

.auth-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #cbd5e1;
}

.auth-field input {
  font-family: var(--auth-font);
  background: var(--auth-input-bg);
  border: 1px solid var(--auth-input-border);
  color: var(--auth-text-main);
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  font-size: 0.92rem;
  outline: none;
  transition: all 0.15s;
}

.auth-field input:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.auth-btn {
  font-family: var(--auth-font);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  width: 100%;
  transition: all 0.15s ease-in-out;
}

.auth-btn-primary {
  background: var(--auth-primary);
  color: #031c27;
}

.auth-btn-primary:hover {
  background: var(--auth-primary-hover);
  color: #fff;
}

.auth-btn-secondary {
  background: transparent;
  border: 1px solid var(--auth-modal-border);
  color: var(--auth-text-muted);
  margin-top: 0.5rem;
}

.auth-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--auth-text-main);
}

.auth-switch {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.82rem;
  color: var(--auth-text-muted);
}

.auth-switch button {
  background: none;
  border: none;
  color: var(--auth-primary);
  font-weight: 600;
  cursor: pointer;
  padding: 0 0.25rem;
}

.auth-switch button:hover {
  text-decoration: underline;
}

.auth-msg {
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  margin-bottom: 1rem;
  line-height: 1.4;
  display: none;
}

.auth-msg.error {
  display: block;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.auth-msg.success {
  display: block;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #86efac;
}

/* User Badge */
.auth-user-badge {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 999;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(15, 23, 34, 0.9);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-family: var(--auth-font);
  font-size: 0.8rem;
  color: #e2e8f0;
}

.auth-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--auth-primary);
  color: #031c27;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.7rem;
}

.auth-tag {
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.auth-tag-admin {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.auth-badge-link {
  color: var(--auth-text-muted);
  text-decoration: none;
  font-size: 0.75rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

.auth-badge-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
