/* ==========================================================================
   Eneon Users & Profile — Apple SaaS Design System (Dashboard-aligned)
   ========================================================================== */

.apple-user-hero-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #cbd5e1;
  border-top: 2px solid #2563eb;
  border-radius: 16px;
  padding: 1rem 1.25rem;
  box-shadow:
    0 4px 14px -2px rgba(15, 23, 42, 0.05),
    0 1px 3px 0 rgba(15, 23, 42, 0.03);
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .apple-user-hero-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.apple-hero-avatar-wrap {
  position: relative;
  width: 54px;
  height: 54px;
  flex-shrink: 0;
}

.apple-hero-avatar-img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

.apple-hero-avatar-shield {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #dcfce7;
  color: #15803d;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Etiquetas y campos de formulario estilo Apple / Dashboard */
.apple-field-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.38rem;
  letter-spacing: -0.005em;
}

.apple-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.apple-input-icon {
  position: absolute;
  left: 12px;
  color: #64748b;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  z-index: 2;
}

.apple-form-control {
  width: 100%;
  border-radius: 10px !important;
  border: 1px solid #cbd5e1 !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
  font-size: 0.84rem !important;
  font-weight: 500 !important;
  padding: 0.52rem 0.85rem !important;
  transition: all 0.16s ease-in-out !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02) !important;
}

.apple-form-control.with-icon,
.apple-input-wrap > .apple-form-control:not(.apple-form-control-no-icon),
.apple-input-wrap .flatpickr-input.apple-form-control:not(.apple-form-control-no-icon) {
  padding-left: 2.35rem !important;
}

.apple-form-control.with-right-btn {
  padding-right: 2.6rem !important;
}

.apple-form-control:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
  outline: none !important;
}

.apple-eye-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 3;
}

.apple-eye-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* Aviso celeste estilo Apple Security */
.apple-security-notice {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    rgba(224, 242, 254, 0.72) 0%,
    rgba(236, 254, 255, 0.65) 100%
  );
  border: 1px solid #bae6fd;
  color: #0369a1;
  font-size: 0.78rem;
  font-weight: 500;
}

/* Medidor de fuerza de contraseña estilo Apple */
.apple-strength-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.55rem;
  padding: 0.6rem 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

@media (max-width: 576px) {
  .apple-strength-grid {
    grid-template-columns: 1fr;
  }
}

.apple-strength-item {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  font-size: 0.74rem;
  font-weight: 600;
}

.apple-strength-item.valid {
  color: #059669;
}

.apple-strength-item.invalid {
  color: #64748b;
}

/* Tarjeta de switch iOS para Usuario Activo */
.apple-switch-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  min-height: 40px;
}

.apple-switch-box.is-active {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

/* Leyenda de permisos estilo SaaS */
.apple-legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.24rem 0.68rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
}

.apple-legend-pill.inherited {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.apple-legend-pill.additional {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.apple-legend-pill.revoked {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.apple-legend-pill.available {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* Acordeón de secciones de permisos */
.apple-permissions-accordion .accordion-item {
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  overflow: hidden;
  margin-bottom: 0.75rem;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

.apple-permissions-accordion .accordion-button {
  background: #f8fafc !important;
  color: #0f172a !important;
  font-weight: 700 !important;
  font-size: 0.88rem !important;
  padding: 0.75rem 1rem !important;
  box-shadow: none !important;
}

.apple-permissions-accordion .accordion-button:not(.collapsed) {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.apple-permissions-accordion .accordion-body {
  padding: 0.9rem 1rem !important;
  background: #f8fafc;
}

/* Tarjeta individual de pantalla/opción de permiso */
.apple-permission-card {
  height: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
}

.apple-permission-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 6px 16px -4px rgba(37, 99, 235, 0.08);
}

.apple-permission-card-header {
  padding: 0.65rem 0.9rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.apple-permission-card-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

.apple-permission-card-path {
  font-size: 0.68rem;
  font-weight: 600;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  margin-top: 0.12rem;
  display: block;
}

.apple-permission-card-body {
  padding: 0.75rem 0.9rem;
  flex-grow: 1;
}

.apple-permission-action-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  transition: background-color 0.12s ease;
}

.apple-permission-action-row:hover {
  background-color: #f8fafc;
}

.apple-permission-action-row + .apple-permission-action-row {
  border-top: 1px dashed #e2e8f0;
}

/* ==========================================================================
   Sección Apple macOS de Doble Factor (2FA) y Dispositivos de Confianza
   ========================================================================== */

.apple-2fa-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #cbd5e1;
  border-top: 2px solid #10b981;
  border-radius: 16px;
  box-shadow:
    0 8px 24px -6px rgba(15, 23, 42, 0.06),
    0 2px 6px -1px rgba(15, 23, 42, 0.03);
  overflow: hidden;
  margin-bottom: 1rem;
}

.apple-2fa-card.is-inactive {
  border-top-color: #2563eb;
}

.apple-2fa-banner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    rgba(240, 253, 244, 0.9) 0%,
    rgba(224, 242, 254, 0.65) 100%
  );
  border: 1px solid #bbf7d0;
}

.apple-2fa-banner.inactive {
  background: linear-gradient(
    135deg,
    rgba(239, 246, 255, 0.9) 0%,
    rgba(248, 250, 252, 0.95) 100%
  );
  border-color: #bfdbfe;
}

@media (min-width: 768px) {
  .apple-2fa-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.apple-2fa-icon-orb {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(145deg, #dcfce7 0%, #bbf7d0 100%);
  color: #15803d;
  border: 1px solid #86efac;
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.14);
}

.apple-2fa-icon-orb.inactive {
  background: linear-gradient(145deg, #eff6ff 0%, #dbeafe 100%);
  color: #2563eb;
  border-color: #93c5fd;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.14);
}

.apple-qr-frame {
  width: 224px;
  height: 224px;
  margin: 0 auto;
  padding: 14px;
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #cbd5e1;
  box-shadow:
    0 12px 28px -8px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.apple-qr-frame svg {
  width: 100% !important;
  height: 100% !important;
  max-width: 196px;
  max-height: 196px;
}

.apple-secret-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.05em;
}

.apple-recovery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  padding: 0.75rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
}

.apple-recovery-code {
  padding: 0.38rem 0.6rem;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e293b;
  text-align: center;
  letter-spacing: 0.06em;
}

.apple-totp-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.35em !important;
  text-align: center !important;
  padding: 0.6rem 1rem !important;
  border-radius: 12px !important;
}

.apple-device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.95rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.apple-device-row + .apple-device-row {
  margin-top: 0.5rem;
}

.apple-device-row:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

